Re: Play sound at wanted frequency
On 15 Apr, 19:25, Scott David Daniels scott.dani...@acm.org wrote: Diez B. Roggisch wrote: Matteo schrieb: I need to playback a sound on a linux machine of a pre-determined frequency like, say, 440 Hz. How can I do that with python? I found the ossaudiodev package, but it says that the ossaudiodev.write() method accepts data as a raw string. It doesn't explain what the string should be like, and the oss documentation is mainly about C++. Do you have any tips to share? Try pygame. You can create samples with it, and play them. See e.g. this:http://www.pygame.org/docs/ref/sndarray.html And realize that if you can get that to work, you can always cut into pygame to see how _it_ accomplishes your task, and mimic that. --Scott David Daniels scott.dani...@acm.org I'll give it a try, thanks ;) -- http://mail.python.org/mailman/listinfo/python-list
Re: Play sound at wanted frequency
Diez B. Roggisch wrote: Matteo schrieb: I need to playback a sound on a linux machine of a pre-determined frequency like, say, 440 Hz. How can I do that with python? I found the ossaudiodev package, but it says that the ossaudiodev.write() method accepts data as a raw string. It doesn't explain what the string should be like, and the oss documentation is mainly about C++. Do you have any tips to share? Try pygame. You can create samples with it, and play them. See e.g. this: http://www.pygame.org/docs/ref/sndarray.html And realize that if you can get that to work, you can always cut into pygame to see how _it_ accomplishes your task, and mimic that. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list
Play sound at wanted frequency
I need to playback a sound on a linux machine of a pre-determined frequency like, say, 440 Hz. How can I do that with python? I found the ossaudiodev package, but it says that the ossaudiodev.write() method accepts data as a raw string. It doesn't explain what the string should be like, and the oss documentation is mainly about C++. Do you have any tips to share? -- http://mail.python.org/mailman/listinfo/python-list
Re: Play sound at wanted frequency
Matteo schrieb: I need to playback a sound on a linux machine of a pre-determined frequency like, say, 440 Hz. How can I do that with python? I found the ossaudiodev package, but it says that the ossaudiodev.write() method accepts data as a raw string. It doesn't explain what the string should be like, and the oss documentation is mainly about C++. Do you have any tips to share? Try pygame. You can create samples with it, and play them. See e.g. this: http://www.pygame.org/docs/ref/sndarray.html Diez -- http://mail.python.org/mailman/listinfo/python-list