playback

Media element Rewind

巧了我就是萌 提交于 2019-11-28 11:15:15
问题 In my application, I play a video file using the MediaElement control, and I need to have fast forward and rewind options. For fast forward, I increased the SpeedRatio , but how can I implement fast rewind? I want to play the video in reverse (in appropriate speed ratio). 回答1: You could set the MediaElement.ScrubbingEnabled property to true, and pause the MediaElement, and then periodically change its MediaElement.Position property backwards to mimic the rewinding behaviour. 来源: https:/

Play Background Sound and Sound Effect in Windows Phone 8

旧街凉风 提交于 2019-11-28 10:27:34
问题 I have researched a lot on playing sounds for Windows Phone 8 devices and found multiple solutions but they don't quite match my case. What I need : I'm writing an app (C#+XAML) that uses a file as background sound (must be active while navigating the whole app), and also to be able to play sound effects. What are the issues : For background sound I could use the BackgroundAudio Agent, but it doesn't meet my requirements because I want the sound to be played only in the background of my app,

C# How to programatically change the playback device

痴心易碎 提交于 2019-11-28 10:09:56
How can I programatically change the default audio device on a vista / win 7 system? Using C# or a Win API call? John Gietzen The WinMM API should provide the functionality that you request. You would use the DRVM_MAPPER_PREFERRED_SET message, which is sent with waveOutMessage() function. Documentation: http://msdn.microsoft.com/en-us/library/aa909789.aspx However, if you are trying to send the waveform sound out yourself, you should look at the WinMM.Net library. http://winmm.codeplex.com 来源: https://stackoverflow.com/questions/1555156/c-sharp-how-to-programatically-change-the-playback-device

Play mp3 sounds from SD card

巧了我就是萌 提交于 2019-11-28 03:24:39
问题 I have a directory on my tablet's SD card called "/Android/data/com.example.android.app/files". I just created it manually because I don't know how else to test this aspect of my app. I have filenames stored in a sqlite database like "/folder1/audio1.mp3", "/folder2/audio1.mp3", etc... The files have the same names, but are in different folders, as they are the same thing is different languages. I have those folders (folder1 and folder2) and all of the mp3 files in the "/Android/data/com

Python: Playing a music in the background?

旧巷老猫 提交于 2019-11-28 02:04:34
问题 I am currently making a game in Python. I am not using PyGame, just the console (non-GUI) When you start the game, you will get the logo to the game, and a lot of information about the "journey" you just started. There is a lot of text, so while the text is scrolling, I want to have a song played in the background. I start the music with the following code: def new_game(): import winsound winsound.PlaySound("intro.wav", winsound.SND_ALIAS) LVL1_INTRO() The only problem is: it won't continue

Play background music in all activities of Android app

自作多情 提交于 2019-11-28 01:53:18
I spend about 20 hours until now and my problem there still is . I am creating an android application that has several Activities (mainMenu , aboutUs,setting). I followed the best answered of below link and that was O.K . Music played using asyncTask isn't stopping by using cancel When i run my app,(my code is in mainActivity ), the music begin and it does not stop when navigate to other Activities . This is GOOD . But i put a ToggleButton in my setting_activity Activity that i hope this Button starts and stops this music. NOW my question is how can i stop and/or start music again from setting

How to record and playback with NAudio using AsioOut

十年热恋 提交于 2019-11-28 00:36:43
I'm trying to get the sound input and send output directly with less latency possible with C#. I'm using the library NAudio that supports ASIO for better latency. In particular, I use the AsioOut object for recording and another for playback initialized with a BufferedWaveProvider , which is filled in a Callback function: OnAudioAvailable , which allows me to use the ASIO buffers. The problem is that I hear the sound with various glitches and with a bit of delay . I think the problem is in the function OnAudioAvailable where the buffer is filled with data taken as input from the sound card.

Playing Audio in HTML

☆樱花仙子☆ 提交于 2019-11-27 23:47:20
问题 I want to play a mp3 audio file in HTML. I don't want to display the whole player with controls like Volume etc. I just need a play/pause button, Designed by me, not the core design of some player, like yahoo player, or google one. For example the audio will be autoplay. When a button (probably an image) is clicked it will pause, and when that image is clicked again, the audio will play again. There are quite few examples here : http://www.w3schools.com/html/html_sounds.asp Can I control any

Playing music in sleep/standby mode in Android 2.3.3

北慕城南 提交于 2019-11-27 23:07:57
问题 I am trying to develop a simple media player to play mp3's of the sdcard/music directory for Android 2.3.3. The problem is when I hit the power button or when the device goes to sleep, the music stops. From googling, and searching stackoverflow, I found that I need to use the wake lock options, but no matter what I do, the music stops when the device goes to sleep (Pressing F7 on the emulator stops the music as well). Since I've been fighting this for way too long, I thought I'd ask for help.

MediaPlayer stop playing after about 5 seconds

家住魔仙堡 提交于 2019-11-27 22:13:02
I'm currently developing a simple game and now it's time to add music and sound effect. I tried using MediaPlayer , just like described here: Android media player bug However I have another problem, the MediaPlayer stop playing the music after about 5 seconds. What is probable causing this? I had this problem too. It was probably due to having the MediaPlayer-object only existing within a method. For example: //ERROR, stops after 5 sec! public static void playMusic(int id) { MediaPlayer mediaPlayer = MediaPlayer.create(context, id); mediaPlayer.setLooping(true); mediaPlayer.start(); } It is