audio-player

Android - MediaPlayer Buffer Size in ICS 4.0

北城余情 提交于 2019-11-27 09:36:23
问题 I'm using a socket as a proxy to the MediaPlayer so I can download and decrypt mp3 audio before writing it to the socket. This is similar to the example shown in the NPR news app however I'm using this for all Android version 2.1 - 4 atm. NPR StreamProxy code - http://code.google.com/p/npr-android-app/source/browse/Npr/src/org/npr/android/news/StreamProxy.java My issue is that playback is fast for 2.1 - 2.3, but in Android 4.0 ICS the MediaPlayer buffers too much data before firing the

Play audio local file with html

末鹿安然 提交于 2019-11-27 05:20:21
I'm trying to do something like this . But I don't know why I'm not getting this thing work. Here it is the codepen example : $('input').on('change', function(e) { var file = e.currentTarget.files[0]; var reader = new FileReader(); reader.onload = function(e) { $('audio source').attr('src', e.target.result); } reader.readAsDataURL(file); }); The source tag is receiving the base64 mp3 file, but it doesn't load the file into browser. You set the src attr directly on the audio element. fiddle var $audio = $('#myAudio'); $('input').on('change', function(e) { var target = e.currentTarget; var file

How do you check if music is playing by using a broadcast receiver?

﹥>﹥吖頭↗ 提交于 2019-11-27 04:07:34
I would like to prevent some of my code from executing only when music or videos are currently playing. How would I accomplish this using a broadcast receiver? You don't need a broadcast receiver for this - AudioManager is your friend: AudioManager.isMusicActive() does the job you want, have a closer look here for details: AudioManager here is an example: AudioManager manager = (AudioManager)this.getSystemService(Context.AUDIO_SERVICE); if(manager.isMusicActive()) { // do something - or do it not } 来源: https://stackoverflow.com/questions/7323915/how-do-you-check-if-music-is-playing-by-using-a

Playing sound during an Inno Setup install

落爺英雄遲暮 提交于 2019-11-27 04:07:08
问题 I wish to use Inno Setup to create an install script for my app but I would like it to play a sound file during install, is this possible? if so can you point me in the right direction! 回答1: 1. Inno Media Player You can use the Inno Media Player library (sorry for self promotion). Here is an example of its use for playing audio file stored as a temporary file inside of a setup. Please note, that Inno Media Player is a Unicode library, and so you can use it only with Unicode versions of Inno

Android: How to create fade-in/fade-out sound effects for any music file that my app plays?

北城余情 提交于 2019-11-27 03:58:38
The application that I am working on plays music files. If a timer expires I want the music to fade out. How do I do that. I am using MediaPlayer to play music and music files are present in raw folder of my application. One way to do it is to use MediaPlayer.setVolume(right, left) and have these values decrement after every iteration..here is a rough idea float volume = 1; float speed = 0.05f; public void FadeOut(float deltaTime) { MediaPlayer.setVolume(volume, volume); volume -= speed* deltaTime } public void FadeIn(float deltaTime) { MediaPlayer.setVolume(volume, volume); volume += speed*

How to download audio/video files from internet and store in iPhone app?

佐手、 提交于 2019-11-27 02:58:40
I am developing an iPhone app for music. I want to give some options to the user so they can listen the song/music by streaming or they can download the music in the app . I know how to stream the audio files in the app programmatically. But, i don't know how to download the audio files in the app and play the audio after download. And also user can pause the download while it is in download. Is it possible to do ? Can anyone please guide me and please share any sample code or tutorial for me? I have one more doubt: Can you please help me to create a folder inside of the app? Please help me.

How to programmatically detect earpiece in iphone?

谁说我不能喝 提交于 2019-11-27 00:31:03
问题 I'm currently working on a project that involves playing music from the iphone music library within the app inside. I'm using MPMediaPickerController to allow the user to select their music and play it using the iPod music player within the iPhone. However, i ran into problem when the user insert his earpiece and removes it. The music will suddenly stop playing for no reason. After some testing, i found out that the iPod player will pause playing when the user unplug his earpiece from the

How to play a .MIDI file in a new thread in Java?

混江龙づ霸主 提交于 2019-11-26 22:12:04
问题 I am remaking part of a game in Java, and I need to know how to play the MIDI sound files. Preferably it would not involve importing any external libraries. It must also be runnable in a new thread, so that I can stack the individual sounds over the background song. Thanks for your thoughts and time. 回答1: This code plays two MIDI tracks at the same time (the 2nd sequence starts as soon as the 1st dialog is dismissed). No threads are explicitly created, but I imagine it would work much the

xcode - MPNowPlayingInfoCenter info is not displayed on iOS 8

≯℡__Kan透↙ 提交于 2019-11-26 20:29:26
问题 I'm developing a music application, which should play music in the background. I use the MPMoviePlayerController to play the music. My code to initiate the MPMoviePlayerController : NSString* resourcePath = [[NSBundle mainBundle] resourcePath]; resourcePath = [resourcePath stringByAppendingString:@"/music.m4a"]; NSError* err; self.player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:resourcePath]]; if (err) { NSLog(@"ERROR: %@", err.localizedDescription); }

Android - Playing mp3 from byte[]

…衆ロ難τιáo~ 提交于 2019-11-26 15:06:49
I have my mp3 file in byte[] (downloaded from an service) and I would like to play it on my device similar to how you can play files: MediaPlayer mp = new MediaPlayer(); mp.setDataSource(PATH_TO_FILE); mp.prepare(); mp.start(); But I can't seem to find a way to do it. I wouldn't mind saving file to phone and then playing it. How can I play the file, or download then play it? OK, thanks to all of you but I needed to play mp3 from byte[] as I get that from .NET webservice (don't wish to store dynamically generated mp3s on server). In the end - there are number of "gotchas" to play simple mp3...