Splitting audio in julia - audio

I want to make some operations with an mp3 file or WAV file, like splitting, but idk how to make it in Julia, i saw that the pkgs LibSndFile.jl, AudioIO.jl and WAV.jl don't work well, is there any library that will help me with that issue?

Related

Exporting a Opus stream to a wav file in Rust

I've gotten a Opus stream (specifically one from Discord voice servers), and I'm trying to convert it to a .wav file that can be used for DeepSpeech. I've already done some internet digging, and found opusdec, which almost perfectly fits my use case. I exported some test files to test upon, but when I tried to use them with opusdec, I got a error:
$ opusdec 293434418808314550478788892773147202909.opus
Decoding complete.
This doesn't look like a Opus file
(the file used above can be downloaded here)
I know these files have no Ogg container in them, so what I'm mainly looking for is a nice way to create a .opus file with a Ogg container in Rust. All the libraries I have found so far seem to be poorly documented, and given how long compiling a test program on my laptop takes, I'm reluctant to do the fiddling around required to use them.
So far, to convert the files to .wav, I've tried using ffmpeg with multiple types of formats passed in (-f s16be, -f libopus) but they either threw a error or resulted in valid wav files, but with static as their contents.
I'm open to a completely different way of doing this, if any are suggested.
Thanks in advance!

How to create simple mp3 file?

How to create simple mp3 file? It can be just one tone 440hz playing for one minute for example. I know that there is the specification of mp3 but it's not so obvious and it is easy to do some mistake and receive incorrect format. May be someone already have any example of source code that create such simple mp3 file? Thank you :)

automatically partition audio files into small parts

I am looking for a way to automatically extract parts from audio files. Something like Imagemagick for audio files.
I only need to extract random parts of a fixed length from a large set of complete ogg-vorbis files. I easily know how to automatically interpret the output from a programm, so I would be able to write a small script if I had programs to do the following:
Get the length of the file
Extract parts of the given an offset in seconds and a length
Is there any program, which allows me to do this under linux? The files I am using are ogg vorbis files.
If there is a python library, which is able to do this, it would work as well.
You can use SoX (Sound eXchange) to do both.

Hashing raw audio data

I'm looking for a solution to this task: I want to open any audio file (MP3,FLAC,WAV), then proceed it to the extracted form and hash this data. The thing is: I don't know how to get this extracted audio data. DirectX could do the job, right? And also, I suppose if I have fo example two MP3 files, both 320kbps and only ID3 tags differ and there's a garbage inside on of the files mixed with audio data (MP3 format allows garbage to be inside) and I extract both files, I should get the exactly same audio data, right? I'd only differ if one file is 128 and the other 320, for example. Okay so, the question is, is there a way to use DirectX to get this extracted audio data? I imagine it'd be some function returning byte array or something. Also, it would be handy to just extract whole file without playback. I want to process hundreds of files so 3-10min/s each (if files have to be played at natural speed for decoding) is way worse that one second for each file (only extracting)
I hope my question is understandable.
Thanks a lot for answers,
Aaron
Use http://sox.sourceforge.net/ (multiplatform). It's faster than realtime as you'd like, and it's designed for batch mode much more than DirectX. For example, sox -r 48k -b 16 -L -c 1 in.mp3 out.raw. Loop that over your hundreds of files using whatever scripting language you like (bash, python, .bat, ...).

Using SAXXMLReader with large zipped xml files

I'm really kind of surprised I couldn't find an answer to this on Google. Especially since xml files lend themselves to being zipped since they are so verbose.
I'm implementing the sax reader from the msxml library in my VB6 program to read large multi-gigabyte xml files from a zip file. Unzipping these files to the hard drive and then reading them is not the way to go since unzipping to disk is not necessary and so slow. This is where my problem comes in.
I can use zlib to read chunks of data from the zip file and process those chunks, but I don't see any way in the SAXXMLReader to process chunks. I've read that the parse method accepts IStream, but I haven't been able to find any method using Google to get an IStream from a zip file.
Can anyone here please provide me an answer to this problem or a pointer in the right direction? Thank you so much for your time.
The idea of getting a stream from the zip file is certainly how I'd deal with this in Java.
I'm not a .Net developer, so it's hard for me to certify this, but it sort of looks like SharpZipLib may have what you're looking for.

Resources