static double volume, balance;
-void AudioSetBalance(double percent)
+public void AudioSetBalance(double percent)
{
balance = percent;
}
-bool AudioSetVolume(VolumeControl type, double percent)
+public bool AudioSetVolume(VolumeControl type, double percent)
{
bool result = false;
if(type == application)
return result;
}
-bool AudioGetVolume(VolumeControl type, double * percent)
+public bool AudioGetVolume(VolumeControl type, double * percent)
{
bool result = false;
if(type == application)
return result;
}
-void OpenMixer()
+public void OpenMixer()
{
snd_mixer_open(&mixer_handle, 0);
snd_mixer_attach(mixer_handle, "default");
snd_mixer_selem_register(mixer_handle, null, null);
}
-void CloseMixer()
+public void CloseMixer()
{
snd_mixer_close(mixer_handle);
}
-int OpenAudio(AudioSpec wanted, AudioSpec result)
+public int OpenAudio(AudioSpec wanted, AudioSpec result)
{
int err;
unsigned int i;
return 1;
}
-void PauseAudio(int value)
+public void PauseAudio(int value)
{
if(!value)
{
}
}
-void CloseAudio()
+public void CloseAudio()
{
soundThread.done = true;
soundThread.Wait();
import "audio"
-void AudioSetBalance(double percent)
+public void AudioSetBalance(double percent)
{
if(streamingSound)
streamingSound.balance = percent;
static HWAVEOUT hWaveOut;
static HMIXEROBJ hmx;
-void OpenMixer()
+public void OpenMixer()
{
HMIXER mixerHandle;
WAVEFORMATEX waveFormat = { 0 };
mixerOpen((HMIXER *)&hmx, (uint)hWaveOut, 0, 0, MIXER_OBJECTF_HWAVEOUT);
}
-void CloseMixer()
+public void CloseMixer()
{
mixerClose((HMIXER)hmx);
waveOutClose(hWaveOut);
}
-bool AudioSetVolume(VolumeControl type, double percent)
+public bool AudioSetVolume(VolumeControl type, double percent)
{
bool result = false;
if(type == application)
return result;
}
-bool AudioGetVolume(VolumeControl type, double * percent)
+public bool AudioGetVolume(VolumeControl type, double * percent)
{
bool result = false;
if(type == application)
return result;
}
-int OpenAudio(AudioSpec wanted, AudioSpec result)
+public int OpenAudio(AudioSpec wanted, AudioSpec result)
{
#define NUM_PLAY_NOTIFICATIONS 16
uint nBlockAlign, dwNotifySize;
return 0;
}
-void PauseAudio(int value)
+public void PauseAudio(int value)
{
if(!value)
{
}
}
-void CloseAudio()
+public void CloseAudio()
{
if(dSoundThread)
{
#include <string.h>
-// define AUDIO_BUFFER_SIZE = 21024;
-define AUDIO_BUFFER_SIZE = 48000;
+// public define AUDIO_BUFFER_SIZE = 21024;
+public define AUDIO_BUFFER_SIZE = 48000;
struct WAVEHDR
{
}
],
"Files" : [
- {
- "Folder" : "audio",
- "Files" : [
- "../../../extras/audio/alsa.ec",
- "../../../extras/audio/audio.ec",
- "../../../extras/audio/dsound.ec"
- ]
- },
"wavPlayer.ec"
],
"ResourcesPath" : "",
-import "ecere"
-import "audio"
-
-#include <string.h>
-
-define AUDIO_BUFFER_SIZE = 21024;
-
-struct WAVEHDR
-{
- byte format[4] __attribute__((packed));
- uint32 f_len __attribute__((packed));
- byte wave_fmt[8] __attribute__((packed));
- uint32 fmt_len __attribute__((packed));
- uint16 fmt_tag __attribute__((packed));
- uint16 channel __attribute__((packed));
- uint32 samples_per_sec __attribute__((packed));
- uint32 avg_bytes_per_sec __attribute__((packed));
- uint16 blk_align __attribute__((packed));
- uint16 bits_per_sample __attribute__((packed));
- byte data[4] __attribute__((packed));
- uint32 data_len __attribute__((packed));
-};
-
-public class Sound
-{
-public:
- int frequency, bits, channels, length;
- byte * data;
-
- ~Sound()
- {
- delete data;
- }
-
- bool Load(char * fileName)
- {
- bool result = false;
- WAVEHDR header;
- File f = FileOpen(fileName, read);
- if(f)
- {
- if(f.Read(header,sizeof(WAVEHDR),1) && !memcmp(header.format,"RIFF",4) && !memcmp(header.wave_fmt,"WAVEfmt ",8))
- {
- data = new byte[header.data_len];
- if(data)
- {
- int c = f.Read(data, 1, header.data_len);
- if(c)
- {
- frequency = header.samples_per_sec;
- bits = header.bits_per_sample;
- channels = header.channel;
- length = Min(header.data_len, c);
- if(c < header.data_len)
- length -= 2048;
- result = true;
- }
- }
- }
- delete f;
- }
- return result;
- }
-}
+import "EcereAudio"
class Form1 : Window
{
{
"Version" : 0.2,
- "ModuleName" : "BitmapAudioKB",
+ "ModuleName" : "PlaySound",
+ "Description" : "",
+ "License" : "",
"Options" : {
"Warnings" : "All",
"TargetType" : "Executable",
- "TargetFileName" : "BitmapAudioKB",
+ "TargetFileName" : "PlaySound",
"Libraries" : [
"ecere"
]