Melopy icon indicating copy to clipboard operation
Melopy copied to clipboard

Live Playing

Open jdan opened this issue 14 years ago • 9 comments

We need to make a play() or sample() method which gives Melopy that capabilities of playing sound right from .data. This shouldn't be terribly hard to achieve, considering programs like Audacity do it without issue. Any ideas?

jdan avatar Aug 31 '11 13:08 jdan

Rendering to memory, and playing it? It's the naive method but we should check if it's not too inefficient it should be OK.

gal-leib avatar Aug 31 '11 13:08 gal-leib

No need to even render into memory. It's already in memory, in the data array. We should be able to play right from it.

jdan avatar Aug 31 '11 13:08 jdan

yes it will be faster, if we could play sound without creating files...

td5r avatar Aug 31 '11 13:08 td5r

we currently we could create hidden temp files, and play it... xD no body will ever know it

td5r avatar Aug 31 '11 13:08 td5r

We're gonna have to use a 3rd-party library.. There is nothing in the standard library that is OS independent.. Look here: http://wiki.python.org/moin/Audio/

gal-leib avatar Aug 31 '11 13:08 gal-leib

http://people.csail.mit.edu/hubert/pyaudio/#examples

td5r avatar Aug 31 '11 13:08 td5r

I will try implementing this feature asap

td5r avatar Aug 31 '11 13:08 td5r

See 2c34064. We have sped up the rendering process twenty-fold, to the point where playing live is close to feasible (we know the speed is there).

jdan avatar Mar 11 '12 02:03 jdan

This could be done easily with Pygame. I recommend something that will try to use a few different libraries...

b1naryth1ef avatar Mar 11 '12 02:03 b1naryth1ef