background-music

How to get music to play in Delphi 7?

大兔子大兔子 提交于 2019-12-05 17:30:52
I need to get music to play in the background in the start of the program in the OnFormActivate event for my program. I have the song I want to use but I dont know what command Delphi needs to use in order to start playing that song. Thanks for you help guys :) Use the TMediaPlayer component, it's on the System tab of the component palette. procedure TForm1.FormActivate(Sender: TObject); begin MediaPlayer1.FileName := '<fill in>.mp3'; MediaPlayer1.Open; MediaPlayer1.Play; end; Set the Visible property to False. Edit in response to OP's comment: To repeat the song, you can use the TTimer

Preferred way to add background music to Android game?

不打扰是莪最后的温柔 提交于 2019-12-04 18:22:09
I want to add background music to my Android game, this needs to be pause able, resume able, etc. I have found this example: http://www.codeproject.com/Articles/258176/Adding-Background-Music-to-Android-App However the line mServ = ((MusicService.ServiceBinderbinder).getService(); Seems to kick up really weird errors, I have no idea what this is trying to do.. If anyone can see how to get this way working or if there is another, better way of doing this? Try this mServ = ((MusicService.ServiceBinder)binder).getService(); Its working for me. Also Change getService() method in MusicService class

Web Usability - Background Music

让人想犯罪 __ 提交于 2019-12-03 08:30:02
问题 I personally loathe background music on a website. My client has opposite feelings on the subject. I added music because the customer is always right, though I'd like to revisit the subject with them. Almost everyone would agree that it is annoying and wastes precious bandwidth but are there any usability studies or a recommendation for someone esteemed in the profession that can provide a valid argument against background music? 回答1: Metrics . You'll never be able to convince a business

How to detect that music play in background

ⅰ亾dé卋堺 提交于 2019-12-02 06:55:46
I want help in detecting if there is a music play in background on the phone or not because I play more than one music sequentially in my app but they are intersection thank you I think what you are looking for is AudioManager.isMusicActive() You can find more detailed info about AudioManager here 来源: https://stackoverflow.com/questions/30953931/how-to-detect-that-music-play-in-background

How to set the title when playing music with remove control on iPhone?

冷暖自知 提交于 2019-12-02 06:03:22
I'm working on a radio app, which supports playing music in background. But i get stuck in how to set the title of music to remove control. The difference between my app and "Music" is as following: What i should do to make my app display the title of a music like "Music" do? Thanks! You can change the text of the now playing label by calling the MPNowPlayingInfoCenter, this will also allow you to modify the song name, album, artist, and album artwork on the lock screen. #import <MediaPlayer/MPNowPlayingInfoCenter.h> #import <MediaPlayer/MPMediaItem.h> MPMediaItemArtwork *albumArt; - (void

fade in and out music while speaking a text

偶尔善良 提交于 2019-12-02 03:35:39
问题 I have an Android application that makes use of TTS (Text to speech) API. Everything is working perfectly, but now i want to fade in/out or even stop music (in case user is playing music with prebuilt Music Player), when application speaks a text. Right now, i think both music and TTS messages are played on the same stream (MUSIC), and it can be difficult to understand the voice messages. I've tried to play the text on a different stream, like AudioManager.STREAM_NOTIFICATIONS. It does stop

fade in and out music while speaking a text

邮差的信 提交于 2019-12-02 03:10:20
I have an Android application that makes use of TTS (Text to speech) API. Everything is working perfectly, but now i want to fade in/out or even stop music (in case user is playing music with prebuilt Music Player), when application speaks a text. Right now, i think both music and TTS messages are played on the same stream (MUSIC), and it can be difficult to understand the voice messages. I've tried to play the text on a different stream, like AudioManager.STREAM_NOTIFICATIONS. It does stop the music, but doesn't come back when the text is spoken, so i didn't achieve the goal. Haven't found

How to set the title when playing music with remove control on iPhone?

萝らか妹 提交于 2019-11-30 07:46:35
I'm working on a radio app, which supports playing music in background. But i get stuck in how to set the title of music to remove control. The difference between my app and "Music" is as following: What i should do to make my app display the title of a music like "Music" do? Thanks! You can change the text of the now playing label by calling the MPNowPlayingInfoCenter, this will also allow you to modify the song name, album, artist, and album artwork on the lock screen. #import <MediaPlayer/MPNowPlayingInfoCenter.h> #import <MediaPlayer/MPMediaItem.h> MPMediaItemArtwork *albumArt; - (void

How to set the title when playing music with remove control on iPhone?

爷,独闯天下 提交于 2019-11-29 10:29:55
问题 I'm working on a radio app, which supports playing music in background. But i get stuck in how to set the title of music to remove control. The difference between my app and "Music" is as following: What i should do to make my app display the title of a music like "Music" do? Thanks! 回答1: You can change the text of the now playing label by calling the MPNowPlayingInfoCenter, this will also allow you to modify the song name, album, artist, and album artwork on the lock screen. #import

Music Loop in Java

痴心易碎 提交于 2019-11-28 13:04:18
Good day! I am doing a game and I want it to have a background sound. I created a class for it and I call it on my main. My code is as follows: import sun.audio.*; import java.io.*; public class Sound { public void music() { AudioStream backgroundMusic; AudioData musicData; AudioPlayer musicPlayer = AudioPlayer.player; ContinuousAudioDataStream loop = null; try { backgroundMusic = new AudioStream(new FileInputStream("chickendance.wav")); musicData = backgroundMusic.getData(); loop = new ContinuousAudioDataStream(musicData); musicPlayer.start(loop); } catch (IOException error) { System.out