I'm trying to play a sound file with python. But when i use the os.system (path\audio.mp3) this opens windows media player and plays the file. Is there a way to make it not open the window but still play the sound?
I've also tried using sound libraries to play the sound like pyaudio to no succes.
Related
I'm trying to open the DellCommandUpdate with python in full screen. I can get the application to open with the first code but couldn't figure out how to maximize the screen. Someone suggested trying sub process. It comes up as a black window similar to cmd.
import os
os.startfile("C:\Program Files (x86)\Dell\CommandUpdate\DellCommandUpdate.exe")
import subprocess
subprocess.call(["cmd", "/c", "start", "/max", "C:\Program Files (x86)\Dell\CommandUpdate\DellCommandUpdate.exe"])
The goal for this is to be able to open the program to be able to click update. I'm not sure if there is something like selenium but for desktop apps or how I would program to automate this
I'm using mergAV to record video on a LiveCode project for iOS. All works fine but when I play an audio mergAVCamSet stops to work and seems it freezes. Is there a way to play audio and have mergAVCamSet continue to work or the two operations collide?
you need to set the audio category to play and record try:
mergAVAudioSessionSetCategory "play and record",false,false,false,true
Note the true at the end there toggles whether the audio will come out of the speaker instead of the receiver.
Recently I have a problem with playing my soundeffects using CocosDenshion. The sound is playing on the iPhone Simulator, but not on my own device. I am not sure what I am doing wrong. Off course I checked if my speakers are still working, but they do while using other apps or the iPod Library.
I just use this simple code:
[[SimpleAudioEngine sharedEngine] playEffect:#"button.wav"];
I double checked the name of the file and it indeed is button.wav.
I hope someone can help me out.
I had the same problem recently and I've figured it out.
I' m using Xcode 4.3.2 and there seems to be a bug.
Not all resources you add (drag) to the project are by default added to the target.
When you add a resource, make sure that (apart from checking the copy items into destination checkbox) you also check the add to target checkbox.
You can check if the resources has been added to the bundle by clicking on the target icon. In the Build Phases tab, check if the sound files are included in the Copy Bundle Resources.
If not, add them manually (+add target)
You might try preloading the sound effects, at some earlier point in the program, as otherwise it has to load the sound effect before it can play it. You could create a splashScreen scene that is the first scene and loads all your assets and then transitions to the first "actual" scene.
SimpleAudioEngine *engine = [SimpleAudioEngine sharedEngine];
[engine preloadEffect:#"Example-Sound.caf"];
Not sure whether it is the case here, but you should keep in mind that if your file name is "Button.wav" and you are asking to playEffect:#"button.wav" it will play on simulator, but will not on the device. This effect takes place because filesystem on your desktop is case-insensative, and on iOS devices it is not.
I have the same problem and find here. But I fix it by myself.
If you reinstall ios for ipad. the default switch(upon the volume) is default as "mute volume" method. Maybe I change it to "rotation" method when it is mute. It lead to all cocos2d can't play sound any more. So I turn the method back and set mute off. And then SimpleAudioEngine works well. It is ios system's bug.
Make sure to check your audio file itself. A Mono 16 Bit, Uncompressed wave with a sample rate of 441000 should 'just work'. I recommend grabbing a sample .wav from an online Cocos2D example, like the Cowbell.wav and try to play that file.
I need to change the soundtrack properties (movie properties tool in QT 7 pro) for a whole bunch of video files. The process would be:
in movie properties click on sound track
and then change the assignment of each audio channel from Mono to "center"
save the file(s)
I am completely unexperienced with Applescript but would it be possible to have a script that would automate that process so I can apply it to all the files without having to do it manually on each QT file?
Quicktime's Applescript support is very limited and the Dictionary only provides access to the most basic of functions (e.g., new movie, play, stop). File settings and properties are not exposed via the Applescript API. There might be something in the Cocoa frameworks, though that's a guess on my part.
I need to whip up a quickie app, something quick and dirty, on windows that lets a user control the tempo of a playing mp3 file with a slider.
Any recommendations on libraries/programming languages/controls that can make this easy?
I don't have control over the media choice (has to be mp3) or the platform (has to be windows)
Edit: Actually, I can convert the files to whatever format is necessary.
Windows Media Player v10+ has this built in. Take a look here. Isn't that what you need?
So far this is what I have found:
2xAV™ Plug-In For Windows Media Player®
Ideally, I would prefer something open source but if I can't find other options I'll give this a go.
You might take a look at this.
Edit: The WinMM.dll has a function called waveOutSetPlaybackRate (P/Invoke) which might be helpful as this DLL (which has been included with windows since Win 9x) can play MP3's. Here is some basic info on how to play the sounds using C#.