Hello,
I have a specific problem I need solving and I'm a bit in the dark regarding the possibilites on python, so I'd love to hear from other peoples experience on the matter. Those not interested in the backstory, feel free to skip to the last bit of text after the following section:
···
--------------------
I'm looking to play a sequence of sound files in sequence within a precision that makes the transition from one file to another inaudible. I think at most 10 ms of difference. The smaller the better. I need to do this on both mac and windows which limits the options a bit. As I see it there are the following possibilites: C++, Java, Flash, Tcl and python. Here's a quick rundown as to why I'm looking at python:
C++: Development time is simply too long as it needs to be cross platform with a few media features.
Java: The JMF extention to java seems to have been untouched in a long time. Inactivity makes me nervous to pick it for the application for fear of future changes and developments.
Flash: Imperical testing has shown the timing to be completely unreliable on this platform. Various "hack" attempts to fix the problem still yielded unacceptable results. It must work every time. Not most of the time.
Tcl: Don't know the language as such. Seems like an ok choice but only one choice in GUI which had a non-native feel.
And then theres python. Hence I'm writing to you experts to hear if you've had any experience regarding this subject...
--------------------
Short version:
Is it possible in python (and wxPython) to time two audio files so they are played in-sync, one after the other with no audible gap in-between. I am indifferent to if the two audio files are written into the same audio buffer and then played, or if they are kept separate and simply synced live. I cannot combine the audio files before running the application, but doing it live is no problem - if its possible that is.
Any experience regarding the issue is very welcome!
Regards,
Gazoo
Take a look at Metronome - wxPyWiki. This shows you how
to play sounds. Python should let you play them together or at least
close enough together that it may not get within 10 ms, but pretty
close.
Josh
···
On Fri, Aug 22, 2008 at 7:21 AM, Lasse Laursen <gazoo@gmx.net> wrote:
Hello,
I have a specific problem I need solving and I'm a bit in the dark regarding
the possibilites on python, so I'd love to hear from other peoples
experience on the matter. Those not interested in the backstory, feel free
to skip to the last bit of text after the following section:
--
Josh English
Joshua.R.English@gmail.com
Lasse Laursen wrote:
Hello,
I have a specific problem I need solving and I'm a bit in the dark regarding the possibilites on python, so I'd love to hear from other peoples experience on the matter. Those not interested in the backstory, feel free to skip to the last bit of text after the following section:
--------------------
I'm looking to play a sequence of sound files in sequence within a precision that makes the transition from one file to another inaudible. I think at most 10 ms of difference. The smaller the better. I need to do this on both mac and windows which limits the options a bit. As I see it there are the following possibilites: C++, Java, Flash, Tcl and python. Here's a quick rundown as to why I'm looking at python:
C++: Development time is simply too long as it needs to be cross platform with a few media features.
Java: The JMF extention to java seems to have been untouched in a long time. Inactivity makes me nervous to pick it for the application for fear of future changes and developments.
Flash: Imperical testing has shown the timing to be completely unreliable on this platform. Various "hack" attempts to fix the problem still yielded unacceptable results. It must work every time. Not most of the time.
Tcl: Don't know the language as such. Seems like an ok choice but only one choice in GUI which had a non-native feel.
And then theres python. Hence I'm writing to you experts to hear if you've had any experience regarding this subject...
--------------------
Short version:
Is it possible in python (and wxPython) to time two audio files so they are played in-sync, one after the other with no audible gap in-between. I am indifferent to if the two audio files are written into the same audio buffer and then played, or if they are kept separate and simply synced live. I cannot combine the audio files before running the application, but doing it live is no problem - if its possible that is.
Any experience regarding the issue is very welcome!
Regards,
Gazoo
</div>
I would look at pygame and pymedia:
http://www.pygame.org/
Also, you may look at how Java or .NET does this sort of thing. If they have an easy way to do it, you could use Jython or IronPython to script them, as they are types of Python that can interface directly with Java classes/objects and .NET classes/objects, respectively.
···
-------------------
Mike Driscoll
Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org
I have never tried to do what you want, but if I were going to do it,
the first thing I would try would be using a pair of MediaCtrls. I
would load the first file into one of the controls, start it playing,
then load the second file into the second control, while the first was
playing. Then I'd use a timer to watch the progress of the first file.
As soon as it completed, I would play the second control, then load
the third file into the first control, and so on.
···
On Fri, Aug 22, 2008 at 10:21 AM, Lasse Laursen <gazoo@gmx.net> wrote:
Is it possible in python (and wxPython) to time two audio files so they are
played in-sync, one after the other with no audible gap in-between. I am
indifferent to if the two audio files are written into the same audio buffer
and then played, or if they are kept separate and simply synced live. I
cannot combine the audio files before running the application, but doing it
live is no problem - if its possible that is.
Any experience regarding the issue is very welcome!
--
Best Regards,
Michael Moriarity