Cut audio file into ten segments

Recommendations welcome how to split a .wav 1 file into time-divided segments using the Python library.

1 Actual file type is not really such material, I am sure that if necessary I can convert between different types.

+3
source share
2 answers

I would suggest looking at the data structure for a given file and “cutting out” the data at the corresponding point along the line so that frames are not dropped earlier.

This would mean looking at the recording frequency and bit rate and using it to get the size (in bits) of each frame. You can then take audio segments without cutting individual frame data.

Check out this SO post . He suggests treating your sound as a binary reading string. Since this is a line, you can basically copy, cut, and move the line as you want into a new output file.

Check it out: http://docs.python.org/library/binascii.html

Also worth a look: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/

, . , , . MP3 , :

http://en.wikipedia.org/wiki/Mp3#File_structure

, .


: , , , : http://sourceforge.net/projects/audiotools/

....

bits_per_sample() from sourceforge.net

- Returns the number of bits-per-sample in this audio file as a positive integer.

, . RAW.

​​ 16. . , .

+2

, , , , 10 , , . ( ) .

+3

Source: https://habr.com/ru/post/1772415/


All Articles