Open GoogleCodeExporter opened 8 years ago
Thanks for filing an issue on this. It looks like the "post" itself is going
well. On the server-side, I would try to print out:
self.headers.getheader('content-length'). If it's the same as the number in
"POST 1892396 bytes of type audio/x-wav", then it's probably the process of
writing the file itself. If the content-length is wrong, then maybe there is
something we can do in SinglePost.as to set it correctly (I'd assumed it was
being set automatically based on the request.data.length).
Original comment by mcgrawian@gmail.com
on 28 Jan 2012 at 6:49
Hi,
I'm sorry, must have been my imperfect English skills.
The audio is sent ok to the server, and gets written to a test.wav file which
plays fine with Winamp.
It also leaves ok the server following the GET request from the client, as
shown by this printout:
Started server...
POST of length 159156
GET of length 159156
Somehow the WamiPlayer client only receives a fraction of it, as shown in the
above printout. It's really strange. Communication is being done, the GET call
gets to the server, which writes a file of the correct size.
I assume there's a problem on the client but can't figure out where it is.
I didn't modify the code in neither the client nor the server, except setting
the correct paths and the server GET printout above.
Original comment by andre...@gmail.com
on 30 Jan 2012 at 10:19
To verify that the client is the problem, did you try to put
"http://localhost:9000" in your browser. In the GET request, you may need to
specify a contentType of "x-wav" and perhaps give a content length. This will
verify that the server is not the problem.
Original comment by mcgrawian@gmail.com
on 1 Feb 2012 at 1:14
Thanks! Following on your advice to look more closer on the server code, I
found this on a website:
# Always read in binary mode. Opening files in text mode may cause
# newline translations, making the actual size of the content
# transmitted *less* than the content-length!
Sure enough, I added "rb" to the open of the GET and it now works!
Thanks again
Original comment by andre...@gmail.com
on 1 Feb 2012 at 7:28
Original comment by mcgrawian@gmail.com
on 4 Feb 2012 at 1:56
I am a newbie and I am trying to capture audio locally on the box. I have the
same specs as this thread, windows 7 with local python running server.py. I
havnt modified server.py but I did modify the index.html file to use URL
"http://localhost:9000". I run the python server and start recording however I
do not know where the file is saving to. Question is where do you specify where
to save the audio wav file and set its filename?
Original comment by shaunaa...@gmail.com
on 21 Feb 2012 at 5:04
That particular server saves it to a directory called /tmp... which probably
doesn't exist on Windows. Look towards the top of the .py file and change the
directory to one of your choosing.
Original comment by mcgrawian@gmail.com
on 21 Feb 2012 at 5:59
Original issue reported on code.google.com by
andre...@gmail.com
on 24 Jan 2012 at 12:00