playsound

How can I play a single tone or custom wave with Delphi?

最后都变了- 提交于 2020-01-02 02:02:06
问题 I looked up some code, seems like everything is creating some math function waves, but I want to a single tone, or a custom wave made with custom single tones. I read this How can I generate continuous tones of varying frequencies? Which is close to my answer. Assumin I'm gonna use waveOutWrite like in the above link, I can't seem to figure out how the amp/freq is calculated for each Sample in HWAVEOUT. In the code from the link It's done like this: Samples[i] := round(vol*sin(omega*t));

How to run a .wav in client. ASP.NET

99封情书 提交于 2019-12-25 07:36:11
问题 I have an application that plays a wave file using the SoundPlayer class. However, when I publish the application in IIS, the file will not play. To use the SoundPlayer class I added a reference windows.dll, it may interfere? public void PlaySound() { try { while (1 == 1) { List<string> distinctMusic = GetMusicFile.Distinct().ToList(); for (int i = 0; i < distinctMusic.Count; i++) { player.SoundLocation = distinctMusic[i]; player.Play(); Thread.Sleep(GetMusicDuration[i] * 1000); player.Stop()

iPhone Vibrate While playing sound

核能气质少年 提交于 2019-12-25 04:42:46
问题 How can I set iPhone to vibrate while playing the sound. The code I use plays the sound firts and then vibrates or vice-versa. Thanks 回答1: You can simply use AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 来源: https://stackoverflow.com/questions/1846881/iphone-vibrate-while-playing-sound

iPhone Vibrate While playing sound

喜欢而已 提交于 2019-12-25 04:42:09
问题 How can I set iPhone to vibrate while playing the sound. The code I use plays the sound firts and then vibrates or vice-versa. Thanks 回答1: You can simply use AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 来源: https://stackoverflow.com/questions/1846881/iphone-vibrate-while-playing-sound

Problem with View.playSoundEffect?

我与影子孤独终老i 提交于 2019-12-24 03:58:07
问题 I'm trying to play a soundEffect (using View.playSoundEffec() method) when a button is focused. The problem is the effects will never be played unless the target phone's Audible Selection is enabled ( It can be enabled from: Settings => Sounds & display => Audible Selection ) What I want is, when the Audible selection isn't enabled, I want to enable it in a programmatic way. Is this possible ? 来源: https://stackoverflow.com/questions/6555410/problem-with-view-playsoundeffect

PlaySound works in Visual Studio but not in standalone exe

▼魔方 西西 提交于 2019-12-13 08:19:13
问题 I am trying to play a wav file in C++ using Visual Studio. I put file "my.wav" in my project directory and use the code PlaySound(TEXT("my.wav"), NULL, SND_FILENAME | SND_SYNC); I hit the play button (or F5 or even Ctrl-F5) and it plays the sound fine. I open a command prompt and go to Debug/ and run MyApp.exe and when it runs it plays the error chime. Note: Ideally the sound would be bundled in the exe so I can just distribute the exe and it would work. I tried putting it in an Resource.rc

Playing mutiple files simultaneously with the PlaySound() API

空扰寡人 提交于 2019-12-12 17:26:14
问题 I've recently discovered how easy it is to play a wav file using the Win32 API PlaySound() function. I'm currently implementing it in my game for my background music. I also plan to use it every time my score increases by one. Unfortunately when I do this, and it plays the score sound, then it stops the background music. Is there a way to have both wav files play simultaneously? 回答1: You can use the SND_NOSTOP flag to achieve this. But you are probably better off using a DirectX technology

Make audio 'resume' after being stopped?

人走茶凉 提交于 2019-12-12 04:58:42
问题 I'm building a Text-Based RPG, and I've managed to add some .wav files to my program with no issue, I'm also able to play them properly with no issue either. What happens currently? I have 2 .wav files, 1 for general background music ( newbieMelody.wav ), and the other for when you level up ( levelUp.wav ). So to start off, when I run my game, we begin with the newbieMelody.wav file to play in the background, like so: #pragma comment(lib, "winmm.lib") #include "Quiz.h" #include <iostream>

How do I detect when the sound has finished playing when using PlaySound in Win32 SDK?

假如想象 提交于 2019-12-11 05:00:08
问题 I am using the PlaySound function from the Win32 SDK to play a wave sound file. Currently, I have the following line of code: PlaySound(szFile,NULL,SND_FILENAME ); But now I want to know, how I can detect the time when the wave file finished playing? I want to change a button's text when the wave stops playing. 回答1: PlaySound is very limited in what it can do. In a product I work on, we built a media playback library on top of DirectSound to do get over the limitations. Among many things it