Node.js send wav on phone with serialport

38 views
Skip to first unread message

Michael

unread,
Apr 24, 2015, 1:23:07 PM4/24/15
to nod...@googlegroups.com
I use node.js to make phone call.

Everything work great, except when I try to send a WAV file.

This is the code I used to send WAV file, but I get only noise.
Any idea ??

this.write( 'AT+FCLASS=8\r', (function( _answer ) {
   this.write( 'AT+VSM=129,8000\r', (function( _answer ) {
      this.write( 'AT+FLO=2\r', (function( _answer ) {
         console.log( 'Set Flo Control : ' + _answer );

         this.write( 'AT+VSD=128,0\r', (function( _answer ) {
            console.log( 'Disable detect silent : ' + _answer );
                    
            this.write( 'AT+VTX\r', (function( _answer ) {
               console.log( 'Set voice : ' + _answer );

               var fs = require( 'fs' );
               fs.readFile( _file, 'base64', (function( _callback, _error, _data ) {
                  if( _error ) {
                     console.log( 'Error on read file : ' + _error );
                  } else {
                     this.write( _data.substr( 44 ) );
                  }
               }).bind( this, _callback ) );
            }).bind( this ) );
         }).bind( this ) );
      }).bind( this ) );
   }).bind( this ) );
}).bind( this ) );
Reply all
Reply to author
Forward
0 new messages