mad-dev-request(a)lists.mars.org wrote:
> Message: 1
> Date: Wed, 30 Jul 2003 16:56:15 -0700 (PDT)
> From: Shiming Dong <dong_sm(a)yahoo.com>
> To: mad-dev(a)lists.mars.org
> Subject: [mad-dev] How to know the frequency of a frame
>
> --0-1603577723-1059609375=:7610
> Content-Type: text/plain; charset=us-ascii
>
> Hi there:
>
> I have one question: I was supposed to implement a program to detect
> a specific marker tone. But my problem is how to know the frequency
> of each frame?
>
> Thank you!
>
> shiming
I guess you mean the samplerate?
For instance 44,1kHz.
In that case it is easy. Once you have decoded a frame, at some point you
will synthesise it to PCM samples.
struct mad_frame myFrame ;
struct mad_synth mySynth ;
[...lots of code...]
mad_synth_frame( &mySynth, &myFrame ) ;
After that mySynth.pcm.samplerate will contain the samplerate.
For instance 44100 for 44,1kHz.
Regards,
Armin