fardog/node-osx-audio

how to play file?

Closed this issue · 4 comments

I have VLC, is there anyway to play the file or save as .mp3 or .ogg?

node-osx-audio doesn't come with any interface of it's own; it's for use in your own projects: that is, you could write an application that integrated this module, and wrote out an mp3 or ogg. At the moment this project is input-only; that is, it's only capable of creating an audio stream from your computer's input, it doesn't output.

your example writes out to a file though. how do I convert that file to mp3? Do you know of a way? I don't know what format that file is.

Ah, I see your question now; yes, the file that gets written out is just an uncompressed WAV, so if you save it with a .wav extension it would play fine. Howver, you can use node-lame and pipe the audio stream provided by node-osx-audio to it, that will give you an mp3 encoded buffer, which you can then write to a file.

please add .wav instead of .txt in your example.