playback

Playing Audio in .Net / C#

守給你的承諾、 提交于 2019-12-02 22:31:37
I'm an experienced MFC programmer of many years, who for the more recent years has been developing commercial apps in Objective C for Mac and iOS - I'm trying to get up to speed with .Net and C# (as I'm soon going to be required to convert one of my commercial apps from Mac to PC). I've now worked my way through a couple of books and as an exercise to get more familiar with .Net (and C#) I've decided to have a go at converting one of my none commercial apps to .Net as a learning exercise and all is going well (interface is working, data structures all good) but I need to be able to play audio.

Directory for storing audio files in Android

守給你的承諾、 提交于 2019-12-02 16:37:30
I want to play an audio file based on the click of a button. I have defined the onClickListener() method and the layout file. When I add the wav files to the res/ directory, I get the following build error: invalid resource directory name temp.wav /hello/res line 1 Android AAPT Problem My question is as follows: 1. What directory do I need to store audio files in? Currently they are in the res/ folder. 2. Also, mp.setDataSource("/res/temp.wav") the correct way to invoke the media player? dont put the media files inside res/ Put your files(temp.wav) in a folder named /sdcard/audio(if you are

Android: How to get app to remember if mute button has been pressed or not

谁说我不能喝 提交于 2019-12-02 16:12:59
问题 I have successfully created a button that mute my button press sound if wanted. The problem I am having is that when I leave the page or close the app and return sound a returned to the default of being on. I am trying to achieve this through preferences but it is not working. I have used preferences before to successfully store high scores but I can get it to work this time as I intend. Here is my sound code: import java.io.IOException; import android.app.Activity; import android.content

Android: How to get app to remember if mute button has been pressed or not

南楼画角 提交于 2019-12-02 10:23:06
I have successfully created a button that mute my button press sound if wanted. The problem I am having is that when I leave the page or close the app and return sound a returned to the default of being on. I am trying to achieve this through preferences but it is not working. I have used preferences before to successfully store high scores but I can get it to work this time as I intend. Here is my sound code: import java.io.IOException; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content

Asterisk- How to 'whisper' music using ChanSpy(), or any alternative? [closed]

醉酒当歌 提交于 2019-12-01 23:04:04
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 11 months ago . I intend to 'whisper' music/message file to one of the conference participants without making this message audible to other conference participants. I went through Audio Manipulation chapter in Asterisk Cookbook (http://ofps.oreilly.com/titles/9781449303822/c03-AudioManipulation

HTML 5 - Play tiny mp3 “inline”

允我心安 提交于 2019-12-01 18:50:28
问题 I want to play a mp3 using HTML 5 audio support. I was trying to use an audio tag but now I am doing it using javascript. My "Player" will be just a tiny Play image, that when is pressed plays the audio (not all the audio control with progress). I am trying to play it using javascript . function playmp3(url){ var audioElement = document.createElement('audio'); audioElement.setAttribute('src', url); audioElement.load(); audioElement.play(); } This is my code and it does not work. It executes

Android, How to play WAV file programmatically

你说的曾经没有我的故事 提交于 2019-12-01 17:17:48
I already have a .wav file in my directory. at the same time i need to play it together with a mp3 file. I used, String recordedFile = "/storage/sdcard0/PINOYKARAOKE/1373597371359.wav"; MediaPlayer recordedSong = new MediaPlayer(); try{ recordedSong = MediaPlayer.create(ctx, Uri.fromFile(recordedFile)); recordedSong.prepare(); recordedSong.start(); } catch(Exception e){ } error: creation failed and it throws IOException Try to create raw folder and put your file there, use this public void number(int num, Context ctx) { AssetManager am; try { am = ctx.getAssets(); AssetFileDescriptor afd = am

Android, How to play WAV file programmatically

做~自己de王妃 提交于 2019-12-01 16:21:08
问题 I already have a .wav file in my directory. at the same time i need to play it together with a mp3 file. I used, String recordedFile = "/storage/sdcard0/PINOYKARAOKE/1373597371359.wav"; MediaPlayer recordedSong = new MediaPlayer(); try{ recordedSong = MediaPlayer.create(ctx, Uri.fromFile(recordedFile)); recordedSong.prepare(); recordedSong.start(); } catch(Exception e){ } error: creation failed and it throws IOException 回答1: Try to create raw folder and put your file there, use this public

IOS - Pause and Unpause Currently Playing Music

断了今生、忘了曾经 提交于 2019-12-01 10:49:39
I am working on a IOS app that I want to have the functionality to pause and unpause music that is currently playing through the ipod, just like the ipod's play/pause button. Is there anyway to do that through IOS? The only answers I have found for this is for dealing with songs and sounds played locally through the app. Any help would be fantastic. Thanks so much! Ole Begemann [[MPMusicPlayerController systemMusicPlayer] play]; [[MPMusicPlayerController systemMusicPlayer] pause]; 来源: https://stackoverflow.com/questions/7043365/ios-pause-and-unpause-currently-playing-music

Media controls notification emits alert on Android O

笑着哭i 提交于 2019-12-01 02:18:08
问题 Ever since adding support for Android O, Android devices running O receive an alert (tone or vibration) whenever my app's media controls notification gets updated (metadata or playback state changes). I'm looking for a way to disable this alert since it's not applicable to media style notifications. Here is the code I use to create a media controls notification: MediaDescriptionCompat description = metadata.getDescription(); String artistName = metadata.getString(MediaMetadataCompat.METADATA