2

I am decoding and playing an aac stream on iOS devices. So far following this tutorial I can tap the stream and get the raw PCM from aac hls packets.

My goal is to get somekind of flag or signal from aac stream and do some UI work afterwards.

I am also in control of the stream from server side so I can insert some silence or wave or flag whatever there except I can't edit much of the metadata or ID3 tags...

My first thought was inserting a 24 hz for 3 seconds. And constantly read the PCM from buffers and when I detect 24 hz do stuff....

But from what I read it seems FFT is not the way to go and detect 24 hz because it consumes to much resources.

What could be the best way to solve this problem?

SpaceDust__
  • 4,844
  • 4
  • 43
  • 82
  • Does your "flag" or "signal" need to be embedded in the AAC bitstream itself? What kind of UI are we talking about? I'm just trying to understand the context a bit better. – ruoho ruotsi Feb 16 '15 at 19:19

1 Answers1

1

To detect specific frequencies or tones in monitored signal, the most frequently used method is Goertzel's Algorithm. Here is a thread on implementing this in C.

Community
  • 1
  • 1
ruoho ruotsi
  • 1,283
  • 14
  • 13