dgurkaynak / nodeshout

Native libshout bindings for node.js
MIT License
50 stars 20 forks source link

Ogg is not working #5

Closed omermecitoglu closed 6 years ago

omermecitoglu commented 6 years ago

mp3 is fine. But I can't play ogg files.

var song = './mysong.ogg'; shout.setFormat(0); // 0=ogg, 1=mp3

"Read 65536 bytes of data" messages flow too fast, then stream stops, listeners can't hear anything.

dgurkaynak commented 6 years ago

Hey @omermecitoglu, sorry for late response. I believe you forgot setting format to ogg. I have just tried this and also update one of the demos as playing ogg file. Check out this commit => https://github.com/dgurkaynak/nodeshout/commit/513b3d5b8e8327dcc63fbb82593f91c739cc8b7c

coolaj86 commented 4 years ago

I also have this problem, despite setFormat(0) being set.

Are any of the shout.setAudioInfo() parameters different for Ogg?

omermecitoglu commented 4 years ago

My ogg file was broken. I have converted it with an online converter and didn't even check if it was working.

dgurkaynak commented 4 years ago

According to libshout docs there are just 4 audio info parameters:

SHOUT_AI_BITRATE - Used to specify the nominal bitrate of the stream. SHOUT_AI_SAMPLERATE - Used to specify the samplerate of the stream. SHOUT_AI_CHANNELS - Used to specify the number of channels (usually one or two). SHOUT_AI_QUALITY - Used to specify the Ogg Vorbis encoding quality of the stream.

However setAudioInfo parameters should be irrelevant, they're for outgoing stream. The issue you have is about reading an ogg file. As @omermecitoglu mentioned, ensure your ogg file is working. You can try with sample ogg file provided in the repo.