How would I use NAudio to get a BPM count from a live stream of a drum track? This should be fairly easy, as each drum strike counts as a beat, so the processing required isn't complex (I guess), but I am unsure how to go about detecting the peaks in the signal.
↧
New Post: Beats Per Minute from live drum stream
↧
New Post: IWaveProvider - streaming 16Bit PCM audio
I have previously created a IWaveProvider to convert streaming Mulaw to PCM and play the audio back. I am now using the same provider to use a specific WaveFormat based on an RTSP describe value of L16/16000/2, which should be PCM 16 bit, 16000hz 2 channels. So my WaveFormat is defined as follows:
waveFormat = new WaveFormat(16000,16,2);
When I use the AddSamples method, I am simply writing out the byte array directly to my circular buffer:written = circularBuffer.Write(buffer, offset, count);
However, on playback, it is definitely not the correct format. Just wondering if I should be converting the incoming data before adding it to the circular buffer?↧
↧
New Post: Make build with internal class ASIODriver public?
Hi,
at first: please excuse my bad english.
We developed a commercial application which uses NAudio. But since we developed some custom sort of WaveProvider we need to access the internal class ASIODriver in NAudio.
Would it be okay to make a custom build settings these ASIO classes to "public"?
If so, how should we name that assembly? I dont think it would be a good idea to name it also NAudio because of the slight modification. Should we rename the assembly to "NAudio_mod" (for example) to match license requirements?
Thanks for all replies in advance,
Z74
at first: please excuse my bad english.
We developed a commercial application which uses NAudio. But since we developed some custom sort of WaveProvider we need to access the internal class ASIODriver in NAudio.
Would it be okay to make a custom build settings these ASIO classes to "public"?
If so, how should we name that assembly? I dont think it would be a good idea to name it also NAudio because of the slight modification. Should we rename the assembly to "NAudio_mod" (for example) to match license requirements?
Thanks for all replies in advance,
Z74
↧
New Post: Beats Per Minute from live drum stream
I think you have to capture the signal and then process an Fast-Fourier-Transform to detect low-frequencie-peaks only (its not enough to search for peaks), for example below 120 Hz. It`s some sort of complex - but if you find a FFT-Method it would not that hard when you only look for low-frequency peaks.
Please excuse my bad english.
Please excuse my bad english.
↧
New Post: IWaveProvider - streaming 16Bit PCM audio
one way to diagnose problems like this, is to use the WaveFileWriter to create a WAV file. If it doesn't play back correctly, try different WAV formats until you hear it correctly. That will help you find out what waveformat you really have
↧
↧
New Post: Make build with internal class ASIODriver public?
Hi, NAudio uses the Microsoft Public License (MS-PL), which is very permissive, and allows you to take the code and use it within your own commercial applications. It would be best if you change the assembly name slightly. If it is only one class you are changing, you might even find you can just copy the code for that class out and use it instead - NAudio is fairly loosely coupled.
If the changes you have made are not too specific to your particular application, you might want to consider sharing them here. If they would benefit other NAudio users, I could perhaps incorporate them into the core library.
And if you want to share the a link to your commercial application, I'd be glad to reference it on the homepage of the NAudio project.
Mark
If the changes you have made are not too specific to your particular application, you might want to consider sharing them here. If they would benefit other NAudio users, I could perhaps incorporate them into the core library.
And if you want to share the a link to your commercial application, I'd be glad to reference it on the homepage of the NAudio project.
Mark
↧
New Post: Windows 8 WinRT Metro Style Support
hi, the WinRT support is coming along reasonably well, although I haven't had a chance to work on it in the last few weeks. If you get the latest code out, you can see what has been done so far. The WPF drawing code might be able to translate across, as WinRT has a very similar XAML-based graphics system.
Mark
Mark
↧
New Post: Pitch Detection
Thanks for the reply.
I have discovered a problem with the code, but I am not sure why the error is happening.
The byte[] buffer is always filled with 0s and never any content. Is this right?
Also, am I right in believing that the byte[] should be filled with sample values after the read command?
Thanks again for any advice or clarification.
I have discovered a problem with the code, but I am not sure why the error is happening.
The byte[] buffer is always filled with 0s and never any content. Is this right?
Also, am I right in believing that the byte[] should be filled with sample values after the read command?
Thanks again for any advice or clarification.
↧
Commented Issue: Two Common Controller Constants Missing From MidiController Enum [16388]
It would be nice if the common controller values BankSelectMSB (0) and BankSelectLSB (32) were added to the MIdiContoller enum. The current workaround is to simply specify the integer values, but an enum entry would make things a lot clearer.
A complete list of controller values is available at:
http://www.midi.org/techspecs/midimessages.php#3
Comments: thanks for implementing my suggestion!
A complete list of controller values is available at:
http://www.midi.org/techspecs/midimessages.php#3
Comments: thanks for implementing my suggestion!
↧
↧
New Post: Beats Per Minute from live drum stream
Thanks for that advice Z74.
↧
New Post: Pitch Detection
Yes, after each call to read there should be data in the buffer. Does bytesRead return a non-zero value?
↧
New Post: IWaveProvider - streaming 16Bit PCM audio
The PCM data was streamed from the network and was big endian, after swapping the bytes to make it little endian, the audio played fine. Saw that in another thread.
↧
New Post: Play same file multiple times using WaveOutEvent
Hello all,
I am using WaveOutEvent and AudioFileReader class to play my audio files. I wanted to provide a functionality where user can play a given file for specified duration. Here there is a scenario where audio file duration could be less than the duration specified by user. So I want to replay the same file again and again until user specified duration completes. I tried following ways:
If we set the Position of AudioFileReader to zero and then call WaveOutEvent.Play then its not working! Why so?
Thanks.
I am using WaveOutEvent and AudioFileReader class to play my audio files. I wanted to provide a functionality where user can play a given file for specified duration. Here there is a scenario where audio file duration could be less than the duration specified by user. So I want to replay the same file again and again until user specified duration completes. I tried following ways:
- Create WaveOutEvent instance, initialize it, play file, on PlayingStopped dispose this instance, create new WaveOutEvent instance, initialize it, play file, ... until duration completes. [But continuously creating and disposing WaveOutEvent instance throws AccessViolationException after some time]
-
Create WaveOutEvent instance, initialize it, play file, on PlayingStopped initalize it again, play file, ... until duration completes, and then dispose WaveOutEvent. [But this way is raising MMException with AlreadyAllocated result]
If we set the Position of AudioFileReader to zero and then call WaveOutEvent.Play then its not working! Why so?
Thanks.
↧
↧
New Post: Pitch Detection
Yes, bytesRead does return a non-zero value until it reaches the end of the file, where its zero.
↧
New Post: Do I need to ship NAudio.xml in the end user installer?
Hi Mark,
I'm planning on including NAudio.dll, NAudio.WindowsMediaFormat.dll and the NAudio license text file in my app MSI installer file.
I'm assuming I do NOT need to include NAudio.xml with the app because that is just for development intellisense. Correct?
The app seems to run fine without it, but I want to make sure I before I publish.
Thanks.
I'm planning on including NAudio.dll, NAudio.WindowsMediaFormat.dll and the NAudio license text file in my app MSI installer file.
I'm assuming I do NOT need to include NAudio.xml with the app because that is just for development intellisense. Correct?
The app seems to run fine without it, but I want to make sure I before I publish.
Thanks.
↧
New Post: Do I need to ship NAudio.xml in the end user installer?
yes that's right
↧
New Post: Do I need to ship NAudio.xml in the end user installer?
Great. Thanks Mark.
↧
↧
New Post: Sending SysEx data
Have there been any changes to NAudio in the last two years to support sending a SysEx message? I have 8 bytes (F0......F7) I need to send to my midi hardware and am trying to avoid using another library. Can a method be readily added to NAudio to simply send an array of raw byte values out the opened midi port?
If I cannot use NAudio, the C# Midi Toolkit (http://www.codeproject.com/Articles/6228/C-MIDI-Toolkit) is the only readily available managed MIDI library that I am aware of which supports SysEx. (If anyone knows of an alternative library, please let me know.)
Thanks,
Greg
If I cannot use NAudio, the C# Midi Toolkit (http://www.codeproject.com/Articles/6228/C-MIDI-Toolkit) is the only readily available managed MIDI library that I am aware of which supports SysEx. (If anyone knows of an alternative library, please let me know.)
Thanks,
Greg
↧
New Post: Sending SysEx data
No, I'm afraid no new sysex features have been added to NAudio. I'll gladly accept contributions in this area. If you're looking for a MIDI library, I'd take a look at Marc Jacobi's MIDI.NET.
↧
New Post: Sending SysEx data
Thanks for the heads up on Marc Jacobi's MIDI.NET. I am familiar with his VST.NET tool.
↧