I am a newbie to sound processing, please excuse silly questions!
I am going to process (play) wav files in a C-programm. Want to activate (play) selected sound sniplets within a longer sound stream. Appropriate sniplets (with a START point and an END point in Byte offsets from the file enty point) I intend to identify by Audacity in this WAV file before.
My simple processing idea: I identify by audacity an appropriate sound sequence and audacity displays the Byte offsets (from the file enty point) to the START of the sequence and the END of the sequence.
These two Byte offstes I will notice (write in a seperate CSV file ? / add to the wav file ?).
In my C-program I will jump the WAV file pointer to the START offset, activate my ALSA based replay routines and stop replaying when the END Byte offset has been reached.
Any good advice how to simplify?
Rough idea myself: I let audacity display the byte offsets of the START point and the END point on my screen and copy them in a CSV file …!
Up to now I have no idea, how I can motivate audacity to show me the Byte offsets in an opened wav file. Are there plugins available?
You have some WAV files, and you want to know the number of bytes from the beginning of the file to a specific “start play time”, and the number of bytes from the beginning of the file to a specific “end play time”.
I intend to identify appropriate sound steps corresponding to the model engine RPM (0% … 100%) in the WAV file by the help of audacity. When controlling the electical engine by PWM I want replay the appropriate sound sniplet from the wav file. Therefore I need the exact byte position which corresponds to the intended PWM level (255 sniplets).
Calulating the offset by your proposed formula is very helpful - thank you, I wonder if the time resolution (microseconds ?) will be unique enough to jump to the before identified zero-crossings of the amplitude in order to avoid any cracks when linking neighboured sound sniplets in my program?
Supposed it is not - can I identify by programming methods (e.g. pattern matching in the wav byte sequences) the most nearby zero crossing amplitude to make up a unique marker?
Actually - I have found a possible doable solution meanwhile:
I can mark a wav files with labels - didn’t know that. The time resolution for the labels is xx.yyyyyy (6 digits after period) which should be a sufficient resolution to refind the time marked postion with time to byte calculation. As labels can be stored in an adjacent .txt ASCII file, I can open the txt file in parallel to the wav file and identify lables - forwarding and backwarding to the relevant relative byte position in the wav files.
This seems a doable approach to start programming with.
Thanks a lot for pushing me into the right direction.