Is there any command in Python for sound creation?? Using python 3 and 2.7 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Is there any command in Python for sound creation?? Using python 3 and 2.7

7th Jun 2018, 2:39 PM
Kunal J.
Kunal J. - avatar
5 Answers
+ 3
Yes, but without modules it would be hard, by opening a sound file in binary read more, but it is too difficult, when I tried: (len(open("/storage/emulated/0/S/Sound_files/test1.wav", "rb").read())) Results about 15000 bytes long binary string for only a sound file of 5 seconds, but this can be done by using some modules, https://pypi.org/
7th Jun 2018, 3:39 PM
Seb TheS
Seb TheS - avatar
0
Thank you, but, umm, I am unable to find a sound module at pypi.orh
8th Jun 2018, 12:38 AM
Kunal J.
Kunal J. - avatar
0
I found a way for sound edition: I tried to edit 5 second long .wav file it started with: RIFF\x04\xeb\x02\x00WAVEfmt I tried to edit 10 second long .wav file it started with: RIFFD\xe5\x04\x00WAVEfmt I could index the file and make a sound file sound different, but the length of sound wave were defined inside: RIFF\x04\xeb\x02\x00WAVEfmt RIFFD\xe5\x04\x00WAVEfmt, rest of the sound file is just \x<Hex><Hex> thousands of times and some random character s, I could just move and reverse the Binary string characters in a sound file making weird sounds, I couldn't self create sounds, because I couldn't use b"\", that caused some errors and using b"//" broked the file for being a binary file. How much do you know about files and binary strings? Making sound files without modules needs a lot of knowledge about text printed by: print(open("Test1.wav", "rb").read()) I am right trying to learn to use it, it is interesting and would be used to create images-, video- and soundfiles.
8th Jun 2018, 1:56 PM
Seb TheS
Seb TheS - avatar
0
thus: for 5 seconds long sound file: RIFF\x04\xeb\x02\x00WAVEfmt In numbers: 82, 73, 70, 70\4\235\2\0, 87, 65, 86, 69, 102, 109, 116 for 10 seconds long sound file: RIFFD\xe5\x04\x00WAVEfmt In numbers: 82, 73, 70, 70, 68\229\4\0, 87, 65, 86, 69, 102, 109, 116
9th Jun 2018, 9:46 AM
Seb TheS
Seb TheS - avatar