Play WAV file in Python

You can use PyAudio. An example here on my Linux it works: #!usr/bin/env python #coding=utf-8 import pyaudio import wave #define stream chunk chunk = 1024 #open a wav format music f = wave.open(r”/usr/share/sounds/alsa/Rear_Center.wav”,”rb”) #instantiate PyAudio p = pyaudio.PyAudio() #open stream stream = p.open(format = p.get_format_from_width(f.getsampwidth()), channels = f.getnchannels(), rate = f.getframerate(), output = True) #read … Read more

Mixing Audio Files

Unfortunately, I don’t think there’s anything on the device to do file mixdowns. As I see it, you’ve got two options: 1) Send both files to a server and use ffmpeg or some other free tool to do the mixdowns. 2) If it’s something that must stay local to the phone, you could load the … Read more

Batch File To Play A Song

Here is a Bat/VBS to play an audio file : @echo off set file=track12.mp3 ( echo Set Sound = CreateObject(“WMPlayer.OCX.7″^) echo Sound.URL = “%file%” echo Sound.Controls.play echo do while Sound.currentmedia.duration = 0 echo wscript.sleep 100 echo loop echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000) >sound.vbs start /min sound.vbs

MediaElementAudioSource outputs zeroes due to CORS access restrictions

In my response I will assume the following setup: Your stream URL is http://stream.radio.com:8000/mount (or http://stream.radio.com:8000/;stream/1 for Shoutcast) Your paget URL where you place your HTML/JS code URL is http://radio.com/player To get this working you need: Set the “Access-Control-Allow-Origin” header of your stream to your domain or * In javascript, set audio tag crossOrigin property … Read more

Google Script: Play Sound when a specific cell change the Value

This is a pretty tough problem, but it can be done with a sidebar that periodically polls the H column for changes. Code.gs // creates a custom menu when the spreadsheet is opened function onOpen() { var ui = SpreadsheetApp.getUi() .createMenu(‘Call App’) .addItem(‘Open Call Notifier’, ‘openCallNotifier’) .addToUi(); // you could also open the call notifier … Read more

Playing Multiple sounds at the same time in Android

Having the following class to play sound fx using sound pool: public class SoundManager { public static int SOUNDPOOLSND_MENU_BTN = 0; public static int SOUNDPOOLSND_WIN = 1; public static int SOUNDPOOLSND_LOOSE = 2; public static int SOUNDPOOLSND_DRAW = 3; public static int SOUNDPOOLSND_TICK1 = 4; public static int SOUNDPOOLSND_TICK2 = 5; public static int SOUNDPOOLSND_OUT_OF_TIME … Read more