32 bit mp3

Feb 17, 2010 at 9:33 PM

I have an mp3 that pulls up in Audacity as a 32 bit float.  When I load it with the WaveStream, the TotalTime parameter is twice as long as the actual music file due to the increased bit depth.  Is there a way to check the bit depth of the file and adjust the TotalTime parameter accordingly?  If I save the mp3 using Audacity as a 16 bit file, NAudio reports the time correctly when I load it into the WaveStream.  It seems that it is treating any mp3 as a 16 bit mp3.  Thanks in advance for the help!

Ryan

Coordinator
Feb 25, 2010 at 9:40 AM

Hi Ryan,

TotalTime is not particularly reliable with MP3s, especially if they are VBR when it is complete guesswork. This aspect of the library probably needs to be re-thought. It was originally written when dealing with telephony audio formats whose length can be accurately calculated.

Mark

Feb 26, 2010 at 3:14 PM

Thanks for the response.  I found another open source C# class that seems to pull out the mp3 specifics very well.  Not sure if you have looked at it yet, but it might be possible to integrate what they have done into Naudio.  Link is http://developer.novell.com/wiki/index.php/TagLib_Sharp.  Naudio is a great tool and has been very helpful.  I have been able to display the whole audio waveform without playback, but now I am working on displaying a color spectrogram from the FFT results.  Having a lot of trouble with that, but hopefully will get something soon.  Any tips or hints would be very helpful. :)

Ryan

Coordinator
Mar 3, 2010 at 11:40 AM

thanks Ryan, let us know how you get on. I have only done some very basic stuff with FFT in NAudio so far.

Mark

 

Mar 2, 2011 at 7:48 PM

Ryan, I'm also trying to figure out how to display an FFT plot. Have you made any progress? If you have any pointers that would be great. Thanks.