cristo-rabani / meteor-universe-audio-recorder

Apache License 2.0
8 stars 2 forks source link

playing.js:13 Audio file not ready! #4

Closed Tzikas closed 9 years ago

Tzikas commented 9 years ago

I've got a couple issues. Im able to insert it into the collection, and after publishing and subscribing it I get the document with SoundsCollection.findOne()

or var audioFile = SoundsCollection.findOne() but audioFile.play() returns playing.js:13 Audio file not ready!_.extend.initPlayer @ playing.js:13_.extend.play @ playing.js:48(anonymous function) @ VM4969:2InjectedScript._evaluateOn @ VM4871:904InjectedScript._evaluateAndWrap @ VM4871:837InjectedScript.evaluate @ VM4871:693 playing.js:50 Uncaught TypeError: Cannot read property 'play' of undefined(…)

Also there's this warning: MediaStream.stop()' is deprecated and will be removed in M47, around November 2015. Please use 'MediaStream.active' instead.

Also if I wanted to access the audio file path from my server file, where in the file directory would it be? www/application/? Thank you so much :+1: :)

cristo-rabani commented 9 years ago

Hello Tzikas,

I checked package today and It seams it works well. Please show me your server side logs and tell what system you use. This package is tested only on linux and only with wav/ogg ( it should work for other systems but it's not tested yet. )

files in developer mode are stored in (project root)/.meteor/local/uniRecorder/uniRecorder/

Tzikas commented 9 years ago

I'm using terminal on a mac. I only get this message on the server side:

UAR: stream to file: /var/folders/vf/38fsn66x58z04p9jkhkwbspm0000gn/T/Dv2auDeYjyu5RoHad.wav

And this is what my collection looks like, I'm not sure why some have status 400 and others have status 200:
{ "_id" : "Zwzsw8iFeNW7yrcQ6", "ownerId" : null, "_writeToken" : "lopeim8z0b", "createdAt" : ISODate("2015-09-18T06:01:23.475Z"), "status" : 400, "path" : "/var/folders/vf/38fsn66x58z04p9jkhkwbspm0000gn/T/Zwzsw8iFeNW7yrcQ6.wav", "extName" : "wav" } { "_id" : "acrKs8AWgAwyRjPgZ", "ownerId" : null, "_writeToken" : "1jajx8yh4ce", "createdAt" : ISODate("2015-09-18T06:19:20.195Z"), "status" : 200, "path" : "/var/folders/vf/38fsn66x58z04p9jkhkwbspm0000gn/T/acrKs8AWgAwyRjPgZ.wav", "extName" : "wav" } { "_id" : "Dv2auDeYjyu5RoHad", "ownerId" : "cJWpZ4k36EqXrZg2a", "_writeToken" : "22rw3ow4i75", "createdAt" : ISODate("2015-09-18T14:53:26.056Z"), "status" : 400, "path" : "/var/folders/vf/38fsn66x58z04p9jkhkwbspm0000gn/T/Dv2auDeYjyu5RoHad.wav", "extName" : "wav" }

And when I try to play it from the console I get these errors:

var audi = SoundsCollection.findOne() undefined audi.play() playing.js:13 Audio file not ready!.extend.initPlayer @ playing.js:13.extend.play @ playing.js:48(anonymous function) @ VM296:2InjectedScript._evaluateOn @ VM192:904InjectedScript._evaluateAndWrap @ VM192:837InjectedScript.evaluate @ VM192:693 playing.js:50 Uncaught TypeError: Cannot read property 'play' of undefined(…)

var auditwo = SoundsCollection.find({"_id" : "acrKs8AWgAwyRjPgZ"}) undefined auditwo L…n.Cursor {collection: LocalCollection, sorter: null, _selectorId: undefined, matcher: M…o.Matcher, skip: undefined…} auditwo.play() VM367:2 Uncaught TypeError: auditwo.play is not a function(…)

Tzikas commented 9 years ago

I also tried this:

`'click .record':function(){
    SoundsCollection.startRecording();
    Meteor.setTimeout(function(){
        SoundsCollection.stopRecording();
        console.log('stopped record ing ')
        var blah = SoundsCollection.findOne({})
        console.log(blah);
        blah.play();

    }, 5000)`

And got the same playing.js:13 Audio file not ready!.extend.initPlayer @ playing.js:13. error. The file did record into the collection and showed up in the console, but won't play.

cristo-rabani commented 9 years ago

Hello,
Here you are status definitions:

UniRecorder.STATUS_UPLOADED = 200;
UniRecorder.STATUS_DONE = 0;
UniRecorder.STATUS_ERROR = 400;
UniRecorder.STATUS_RECORDING = 100

What kind of file format you use? What browser? Did you tried other?

Do you have sox installed? What version of Sox you have?

Tzikas commented 9 years ago

I just brew install sox so I assume I have the latest version. I get this when I try to run, plus a 400 status in the collection, and an Audio file not ready! error on the console.

`=> Meteor server restarted I20150919-07:54:04.910(-4)? UAR: stream to file: /var/folders/vf/38fsn66x58z04p9jkhkwbspm0000gn/T/YCMdbSuN6x3hFHBHt.wav I20150919-07:54:08.359(-4)? UAR: Start conversion to "ogg", input: /var/folders/vf/38fsn66x58z04p9jkhkwbspm0000gn/T/YCMdbSuN6x3hFHBHt.wav output: /Users/Squirrel/Documents/Code/Meteor/Memry_8/.meteor/local/uniRecorder/soundsCollection/YCMdbSuN6x3hFHBHt.ogg sox: SoX v

Input File : '/var/folders/vf/38fsn66x58z04p9jkhkwbspm0000gn/T/YCMdbSuN6x3hFHBHt.wav' Channels : 1 Sample Rate : 44100 Precision : 16-bit Sample Encoding: 16-bit Signed Integer PCM Endian Type : little Reverse Nibbles: no Reverse Bits : no sox FAIL formats: no handler for given file type ogg' (STDERR) UAR: Error 2 while converting file: /var/folders/vf/38fsn66x58z04p9jkhkwbspm0000gn/T/YCMdbSuN6x3hFHBHt.wav (STDERR) sox: SoX v (STDERR) (STDERR) Input File : '/var/folders/vf/38fsn66x58z04p9jkhkwbspm0000gn/T/YCMdbSuN6x3hFHBHt.wav' (STDERR) Channels : 1 (STDERR) Sample Rate : 44100 (STDERR) Precision : 16-bit (STDERR) Sample Encoding: 16-bit Signed Integer PCM (STDERR) Endian Type : little (STDERR) Reverse Nibbles: no (STDERR) Reverse Bits : no (STDERR) (STDERR) sox FAIL formats: no handler for given file type ogg' (STDERR)

I changed SoundsCollection = new UniRecorder({ name: 'soundsCollection', targetFileFormat: 'ogg' }); to SoundsCollection = new UniRecorder({ name: 'soundsCollection', targetFileFormat: 'wav' });

and i get this.
=> Meteor server restarted I20150919-07:59:03.608(-4)? UAR: stream to file: /var/folders/vf/38fsn66x58z04p9jkhkwbspm0000gn/T/FWivzy2ru4yg8oNuM.wav I20150919-07:59:07.660(-4)? UAR: Done. /Users/Squirrel/Documents/Code/Meteor/Memry_8/.meteor/local/uniRecorder/soundsCollection/FWivzy2ru4yg8oNuM.wav

And I get a status 0 in my collection which seems good, but then when I call doc.play(), I get this in the console. Uncaught ReferenceError: UniUtils is not defined(…)UniAudioRecord.getURL @ UniRecorder.js:123Player @ player.js:259_.extend.initPlayer @ playing.js:22_.extend.play @ playing.js:48(anonymous function) @ VM2099:2InjectedScript._evaluateOn @ VM2092:904InjectedScript._evaluateAndWrap @ VM2092:837InjectedScript.evaluate @ VM2092:693

Tzikas commented 9 years ago

Ohhh but it does seem to work in Firefox!, I've been using Chrome. Doesn't work perfectly, but I got some playback. In firefox console:

var hmm = SoundsCollection.findOne({"_id":"rTqf63cp6GpdSigro"}) undefined hmm Object { _id: "rTqf63cp6GpdSigro", ownerId: "GpiQLZK2S9CLjEmsY", createdAt: Date 2015-09-19T12:29:53.397Z, status: 0, extName: "wav", size: 303148 } hmm.play() ReferenceError: UniUtils is not defined

Tzikas commented 9 years ago

Also noticed this binary.js:22 WebSocket connection to 'ws://null/' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED error. It goes away when i remove the package, and comes back when I add it again. I'm sorry to be so bothersome. Thanks a lot.

cristo-rabani commented 9 years ago

ReferenceError: UniUtils is not defined Install package vazco:universe-utilities

Binary.js:22 WebSocket connection to 'ws://null/' failed This is nothing to worry, please check: https://github.com/binaryjs/binaryjs/issues/73

OGG files don't work because you don't have ogg codecs for sox. (STDERR) sox FAIL formats: no handler for given file type ogg' (STDERR)

You have this information in error log