Pergunta

Here, my task is to fetch aiff audio details including bit rate. But with this code I am able to fetch sample rate, bits per sample and channel only. Is there any way to get bit rate too?

public void GetAudioDetails()
{
   FileStream fs = new FileStream("..\\guitar.aiff",FileMode.OpenOrCreate,FileAccess.ReadWrite);
   MemoryStream ms = new MemoryStream();
   fs.CopyTo(ms);
   ms.Seek(0, SeekOrigin.Begin);
   var ddf = new AiffFileReader(ms);

}
Foi útil?

Solução

bitrate is average bytes per second * 8. So use the following code:

var bitRate = ddf.WaveFormat.AverageBytesPerSecond * 8;
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top