Currently I am planning crude real time beat detection in this FMod library.
I stucked in a problem.
How can I know the exact beat position?
What I mean is not about Beat Detection Method but about a Beat Positioning method.
I set buffer as 2 sec by “FSOUND_SetBufferSize”. ( at least 2 sec pre reading is really needed).
But as a result, I can’t know the beat position- it is just somewhere in next 2 sec.
- kiplring asked 14 years ago
How about having a small buffersize, and make a larger buffer yourself.
You then put the new data from the callback in your buffer, and you copy the oldest data from your buffer into your callback.
That way you also have a latency of 2 seconds (or whatever size your buffer is) but you know exactly what part of the buffer you have most recently written to the output, so you can use that information to know when the beat is.
Every 2 seconds you can then apply your algorithm to your own buffer.
- Adion answered 14 years ago
Thanks Adion 😀
I have a FIFO(first in first out) buffer code. ( It is used for .wav file processing)
But I stuck in same problem.
How can I transfer the data of 2 sec prev of current playing? ( or Can I get the Data of Any Time without playing it?)
One of the way to do this is FSOUND_SetBufferSize(2000).
p.s. I have to process .mp3 file. Not .wav file.
I assume what you were a little confused about was getting the data without hearing it played out. But because you are using a DSP unit on a stream it can play and get the data but it doesn’t have to be heard by the user. I am just getting into beat detection myself so I will probably be doing some of the same things as you. Also I would expect that the file type does not matter at all because it is just one function that you use to open a stream. This is the only point where the file type is specified and after that all streams are alike I think.
- identitycrisisuk answered 14 years ago
2 sec buffer size.
1) I want to detect 60 bpm ~ 240 bpm. 2sec means at least 2 beat in that buffer.
Brette’s word is right. I can determine beat according to last 2 sec recording.
But I want something more. I want to check a STRONGEST beat – which considered must be the beat. and STRONG beat should be detected before sound out. ( because I ‘m planning to realtime action.)
So I set buffersize that large.
p.s. I’m doing beat check with “FSOUND_Stream_AddSynchPoint” now. Can You give me any advice for Positioning method?
That latency is what I needed.
Because Sound have to go with Strongest Beat information in real time.
I have to read upper & below part of Strong beat to determine whether it is Strongest or Not.
So I decided to make that latency.
Am I wrong?
Please login first to submit.