'how to create an audio file from a binary string in python?
Is there a python function or object that lets me create an audio file (.wav, .mp3 or whatever) and according to a binary string append a beep for every character such that if the character is a 1 the beeps has a specific frequency (lets say 1000Hz) and if it is a 0 the beeps has a different frequency (lets say 1170Hz)? it can´t be in real time since i want it to have several beeps per second (around 40 to 100) and be able to save the output. I know this is a simplified binary frequency shift keying (BFSK) but i havent found a good way to implement it.
I checked the wav library and while it can create sound files it have no way to do the rest. I also checked the pysine and pysinewave libraries and while they can make a sound from a frequency and duration (exactly what i need) they dump the sound straight to the speakers with no way to save it as a file so i can´t use them.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
