Thanks for the reply and yes, that's another way to do it, I'll try it now 
to see how much can I get done :)
My thing was that I wanted to stream the audio from 1 browser to another 
browser, the part of saving it on the server was just for test purposes. I 
tried starting with a stream from the browser mainly to liberate the server 
from needing to compress/encode/transform the audio in any way.

To get the MP3 stream I was trying to use the node-lame (
https://github.com/TooTallNate/node-lame) to encode the thing (it is in 
essence a Transform Stream), but I got stuck in the initial part of getting 
the stream audio to stream from the initial browser to the server and then 
to the other browser

Is my plan very "wrong" or am I on the correct path?

On Tuesday, 30 July 2013 02:38:39 UTC+1, pdeschen wrote:
>
> Hi Joy,
>
> Not familiar with this socket.io-stream, but you can emit PCM buffer 
> (array of floats) without any problem with socket.io. Quickly looking at 
> your code, you could simply have something along the line:
>
> io.on('connection',function(socket) {
>   var pcm = fs.createWriteStream(path.resolve(__dirname, new Date().getTime() 
> + '-audio.pcm'));
>   socket.on('shout', function(data){
>     pcm.write(data);
>   });
>
>   socket.on('end', function(data){
>     pcm.end(data);
>   });
>
> }
>
> Once you can properly save the PCM into some file, I would try to listen 
> to it using sox to make sure you have the expected audio format. Then, if 
> you want to transcode the PCM data into mp3, you could use a 
> stream.Transform[1].
>
> By the way, if you want to support Flash microphone as a backup, you could 
> use microphone.js[2] to which I've contributed a streaming facility.
>
> [1]: http://nodejs.org/api/stream.html#stream_class_stream_transform
> [2]: https://github.com/pdeschen/microphone.js
>
> On Monday, July 29, 2013 10:50:10 AM UTC-4, Joy Dragon wrote:
>>
>> Hi all,
>>
>> I'm trying to make the "old" microphone streaming from the browser with 
>> node, socket.io and ... well a lot of things.
>> I don't want to use Flash, and because the Web Audio API is almost on the 
>> 2 browsers that I want to support (Chrome already has it and Firefox is 
>> almost there)
>> I'm currently able to capture the audio data, and using the socket-io 
>> stream project (https://github.com/nkzawa/socket.io-stream) I can stream 
>> something back to the server-
>> The thing is that I really can't stream it properly, I get some data to 
>> the server, but I have to include a lot of noise in it, and then, when I 
>> want to encode it to MP3 to stream it fails.
>> Here's a sample of my code 
>> https://github.com/joydragon/record-streaming-test if anyone can help me 
>> on a proper way to make this happen I'll be very glad
>>
>> Thanks in advance
>>
>>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to