audio-player

Make UIViewController a singleton?

二次信任 提交于 2019-11-28 07:55:46
问题 During the use of my app, the user should be able to start, stop, forward background music. (Across several UIViewControllers). For this, I made my MusicPlayer a singleton ( NSObject ). If I create the controls in every view for itself it works, but what I want is basically one view which handles the music player class and is present all the time . The user also should be able to "hide" and "show" the view by swiping it to the left or to the right. So if it is hidden and I change my view

Not Getting Thumb with Genres - Universal Music Player

此生再无相见时 提交于 2019-11-28 07:29:43
问题 I am using UMP example provided by Google, I have not made any change in my code, even I have not tried anything out of the box, I just imported your project into my work-space and checked it on my device, and found that I am not getting Thumb with Genres (Songs by genre) and List of Genres... Whereas I supposed to get Thumb from our JSON, here is what I have tried (but no success) - holder.mImageView.setImageBitmap(description.getIconBitmap()); UPDATE # 1 AS PER SUGGESTED BY @NageshSusarla

How to programmatically detect earpiece in iphone?

浪尽此生 提交于 2019-11-28 04:34:52
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 device. So is there any way to programatically detect if the earpiece has been unplug so that i can resume

Hide MP3 full url

耗尽温柔 提交于 2019-11-28 01:19:04
问题 I have a music player that links to a song using the following syntax: <li><a href="" data-src="http://s3.amazonaws.com/audiojs/02-juicy-r.mp3">title</a></li> Is there any way that I could have that executed server side and then be displayed like (see below) for the user? While searching, I ran across this...I like the idea behind having an external file that has the data...like: <?php // get-file.php // call with: http://yoururl.com/path/get-file.php?id=1 $id = (isset($_GET["id"])) ? strval(

xcode - MPNowPlayingInfoCenter info is not displayed on iOS 8

£可爱£侵袭症+ 提交于 2019-11-27 20:54:46
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); } AVAudioSession *session = [AVAudioSession sharedInstance]; [session setCategory

Not able to get getDuration() for AAC file using ExoPlayer

你说的曾经没有我的故事 提交于 2019-11-27 16:30:59
I have been trying to stream a URL using ExoPlayer . The URLs: STREAM_URL_1 = " http://storage.googleapis.com/exoplayer-test-media-0/play.mp3 " STREAM_URL_2 = " https://s3-ap-southeast-1.amazonaws.com/ok.talk.channels/zakirkhan/Zakir+khan+-+when+my+father+took+my+gf%27s+call.aac " Both URLs play but I am not able to get the getDuration() for STREAM_URL_2 which is an .aac file. The .mp3 works. The following is how I do it. How do I get the getDuration() for the 2nd URL. Even seekTo() doesn't work if getDuration() doesn't work. What change should I make? Do I need to change any Extractor ?

Playing sound during an Inno Setup install

余生长醉 提交于 2019-11-27 15:49:09
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! TLama 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 Setup, not with ANSI ones! There is no support for ANSI versions of Inno Setup...! [Setup] AppName

Detecting if music is playing?

柔情痞子 提交于 2019-11-27 14:08:11
问题 My app involves music(iPodMusic), and there is a UISwitch toggling play/pause. My goal is to be able to detect if music is playing, so that therefore the play/pause switch can say 'play' when music is playing and 'pause' if it isn't. 回答1: if ([[MPMusicPlayerController iPodMusicPlayer] playbackState] == MPMusicPlaybackStatePlaying) ... 回答2: If the music is from your own app, check AVAudioPlayer's playing property. If the music is from iPod, check MPMusicPlayerController's nowPlayingItem or

Audio Player play in background and should work based off of hardware mute switch

丶灬走出姿态 提交于 2019-11-27 14:07:44
问题 I want to play audio file in the foreground, background and it should work with mute switch i.e. if mute switch is on, then it should not play, if mute switch is off should play audio. **I'm developing an SIP call application. App should play sound/ringtone when user receives a call. It should play if app is in background/foreground, it should mute/unmute if hardware mute switch is ON/OFF. For this I used AVPlyaer with below code. AVAudioSession *session = [AVAudioSession sharedInstance];

How to play local mp3 file with audioplayer plugin in Flutter

亡梦爱人 提交于 2019-11-27 13:16:52
问题 How to play local mp3 file with audioplayer 0.2.0 in Flutter. pubspec.yaml flutter: assets: - sounds/music.mp3 main.dart Future<ByteData> loadAsset() async { return await rootBundle.load('sounds/music.mp3'); } // FIXME: This code is not working. Future playLocal() async { final result = await audioPlayer.play(loadAsset()); if (result == 1) setState(() => playerState = PlayerState.playing); } Can I get local assets path from rootBundle? Can I pay audio from ByteData on audioPlayer? 回答1: The