New issue 78 by douglas....@gmail.com: LocalAudioFile fails on mono .wav
files
http://code.google.com/p/echo-nest-remix/issues/detail?id=78
What steps will reproduce the problem?
1. Try to LocalAudioFile() with a mono .wav file
2.
3.
What is the expected output? What do you see instead?
The mono .wav file should be opened. If I use a stereo .wav file it work
fine. If I use a mono .wav file it barfs with:
audio_file = audio.LocalAudioFile("/Users/douglas/Desktop/Changes.wav")
en-ffmpeg -i "/Users/douglas/Desktop/Changes.wav"
Traceback (most recent call last):
File "simplesort.py", line 95, in <module>
simplesort(in_filename, out_filename, mode)
File "simplesort.py", line 30, in simplesort
audio_file = audio.LocalAudioFile(in_filename)
File "/Library/Python/2.6/site-packages/echonest/audio.py", line 861, in
__init__
AudioData.__init__(self, filename=filename, verbose=verbose,
defer=defer)
File "/Library/Python/2.6/site-packages/echonest/audio.py", line 305, in
__init__
self.load()
File "/Library/Python/2.6/site-packages/echonest/audio.py", line 331, in
load
data = numpy.frombuffer(raw, dtype="<h", count=sampleSize)
ValueError: buffer is smaller than requested size
This link:
https://github.com/kanaka/noVNC/issues/76
implies it has something to do with Numpy dtype.
Please use labels and text to provide additional information.
Progress!
Running: en-ffmpeg -i "/Users/douglas/Desktop/Changes.wav"
Gives, among other things:
Input #0, wav, from '/Users/douglas/Desktop/Changes.wav':
Duration: 00:00:27.34, bitrate: 705 kb/s
Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
But in audio.py's settings_from_ffmpeg(parsestring) mono is detected like
this:
elif "mono" in s:
#print "mono"
chans = 1
But the version of ffmpeg I'm using doesn't put "mono" in the info string,
it puts "1 channels". So settings_from_ffmpeg is missing that it's mono and
assuming that it's stereo.
If I add:
elif "1 channels" in s:
#print "mono"
chans = 1
Then it no longer barfs when reading a local mono .wav.
However, it still barfs when doing the output, so somewhere else a similar
problem is occurring. I'll try to track that down now.
One more update:
It does work with the change noted above. It fails on add_blips.py, but I
think that's because the blip sounds are stereo .wav files and remix is
having trouble adding stereo blip sounds to a mono source. reverse.py works
perfectly. ones.py does nothing, but I'm not sure if that's related to this
issue or something else...
So should I submit a patch or something to correct the channel detection
code in settings_from_ffmpeg()? And does this need to happen in the
AudioData32 as well?
douglas
douglas
--
............................................... http://artbots.org
.....douglas.....irving........................ http://dorkbot.org
.......................... http://music.columbia.edu/cmc/music-dsp
...........repetto............. http://music.columbia.edu/organism
............................... http://music.columbia.edu/~douglas
Hey Douglas,
A patch would be great. Are you using the included version of ffmpeg or a
custom version? (I'm wondering if we should keep the "elif mono in s" bit
as well for older versions)
Also, we've moved remix over to github, so that would be the place to do
it. (And since it's github, you might want to clone the repo and submit a
pull request) But you can always email us a patch too. Here's a link:
https://github.com/echonest/remix
thanks,
--tyler
doug, are you using the code from github? It fixed some issues for other
users.
Heh, no, I'm using the svn version. I didn't realize you moved to
github. I'm getting that version now, will report back asap.
thanks,
* Checkout the source code using SVN as described
[http://code.google.com/p/echo-nest-remix/source/checkout here].
* Install remix using setup.py:
{{{
sudo python setup.py install
}}}
So that's confusing -- I assume that the install docs just haven't been
updated to reflect that remix is now on github. But do I still trust the
sudio python setup.py install part?
When I run that I get (various copy/build outputs removed for clarity):
dedomonster:echo-nest-remix douglas$ sudo python setup.py install
Password:
running install
running build
running build_py
error: package directory 'pyechonest/pyechonest' does not exist
Sorry if I'm being dense!
For other confused persons, this should work:
git clone g...@github.com:echonest/remix.git
cd remix
git clone g...@github.com:echonest/pyechonest.git
sudo python setup.py install
douglas
Patch submitted.
--
You received this message because you are subscribed to the Google Groups "The Echo Nest Remix API" group.
To post to this group, send email to remi...@googlegroups.com.
To unsubscribe from this group, send email to remix-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/remix-api?hl=en.
git submodule update --init
also worked. I guess the main issue is that none of this seems to be
documented anywhere -- the current install docs refer exclusively to
SVN, even the ones that come down when you do a clone with git. So maybe
an update of the install docs is in order?
douglas
On 11/4/11 10:52 AM, Brian Whitman wrote:
> that should happen automatically via git "external" -- not sure what's
> up with your install
>
>
> On Thu, Nov 3, 2011 at 10:59 PM, douglas repetto
> <dou...@music.columbia.edu <mailto:dou...@music.columbia.edu>> wrote:
>
>
> Ha, solved it. You have to do a git clone of pyechonest
> independently of the remix clone. It'd be really good to put that in
> the install docs! Maybe this is all on the website somewhere??? But
> I don't see it anywhere.
>
> For other confused persons, this should work:
>
>
> git clone g...@github.com:echonest/remix.__git
> cd remix
> git clone g...@github.com:echonest/__pyechonest.git
> sudo python setup.py install
>
>
> douglas
>
>
>
> On 11/3/11 10:47 PM, douglas repetto wrote:
>
>
> Okay, I cloned the remix code from github. But it won't install. In
> INSTALL.txt, it says:
>
> * Checkout the source code using SVN as described
> [http://code.google.com/p/__echo-nest-remix/source/__checkout
> <http://code.google.com/p/echo-nest-remix/source/checkout> here].
> * Install remix using setup.py:
>
> {{{
> sudo python setup.py install
> }}}
>
>
>
> So that's confusing -- I assume that the install docs just
> haven't been
> updated to reflect that remix is now on github. But do I still
> trust the
> sudio python setup.py install part?
>
> When I run that I get (various copy/build outputs removed for
> clarity):
>
> dedomonster:echo-nest-remix douglas$ sudo python setup.py install
> Password:
> running install
> running build
> running build_py
> error: package directory 'pyechonest/pyechonest' does not exist
>
>
> Sorry if I'm being dense!
>
>
> douglas
>
>
>
> --
> ..............................__................. http://artbots.org
> .....douglas.....irving.......__................. http://dorkbot.org
> .......................... http://music.columbia.edu/cmc/__music-dsp
> <http://music.columbia.edu/cmc/music-dsp>
> ...........repetto............__.
> http://music.columbia.edu/__organism
> <http://music.columbia.edu/organism>
> ..............................__.
> http://music.columbia.edu/~__douglas
> <http://music.columbia.edu/~douglas>
>
> --
> You received this message because you are subscribed to the Google
> Groups "The Echo Nest Remix API" group.
> To post to this group, send email to remi...@googlegroups.com
> <mailto:remi...@googlegroups.com>.
> To unsubscribe from this group, send email to
> remix-api+unsubscribe@__googlegroups.com
> <mailto:remix-api%2Bunsu...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/__group/remix-api?hl=en
> <http://groups.google.com/group/remix-api?hl=en>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "The Echo Nest Remix API" group.
> To post to this group, send email to remi...@googlegroups.com.
> To unsubscribe from this group, send email to
> remix-api+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/remix-api?hl=en.
--
(mobile)
http://code.google.com/p/echo-nest-remix/source/checkout
???
douglas