Example #1
0
        //

        public OpenALDataStreamSound(SoundModes mode, int channels, int frequency, int bufferSize, SoundWorld.DataReadDelegate dataReadCallback)
        {
            this.channels         = channels;
            this.frequency        = frequency;
            this.dataReadCallback = dataReadCallback;
            this.bufferSize       = bufferSize;

            //if( !GenerateBuffers( 2 ) )
            //{
            //	Log.Warning( "OpenALSoundSystem: Creating data stream sound failed." );
            //	return;
            //}

            Init(null, mode, 100000.0f, channels, frequency);
        }
Example #2
0
        unsafe public DirectDataStreamSound(SoundMode mode, int channels, int frequency, int bufferSize,
                                            SoundWorld.DataReadDelegate dataReadCallback)
        {
            this.dataReadCallback   = dataReadCallback;
            this.creationBufferSize = bufferSize;

            waveFormat = (WAVEFORMATEX *)NativeUtils.Alloc(NativeMemoryAllocationType.SoundAndVideo,
                                                           sizeof(WAVEFORMATEX));
            NativeUtils.ZeroMemory((IntPtr)waveFormat, sizeof(WAVEFORMATEX));
            waveFormat->wFormatTag      = DSound.WAVE_FORMAT_PCM;
            waveFormat->nChannels       = (ushort)channels;
            waveFormat->nSamplesPerSec  = (uint)frequency;
            waveFormat->wBitsPerSample  = 16;
            waveFormat->nBlockAlign     = (ushort)((waveFormat->nChannels * waveFormat->wBitsPerSample) / 8);
            waveFormat->nAvgBytesPerSec = waveFormat->nSamplesPerSec * waveFormat->nBlockAlign;

            Init(null, mode, 100000.0f, channels, frequency);
        }
Example #3
0
		//

		public OpenALDataStreamSound( SoundMode mode, int channels, int frequency, int bufferSize,
			SoundWorld.DataReadDelegate dataReadCallback )
		{
			this.channels = channels;
			this.frequency = frequency;
			this.dataReadCallback = dataReadCallback;
			this.bufferSize = bufferSize;

			if( !GenerateBuffers( 2 ) )
			{
				Log.Warning( "OpenALSoundSystem: Creating data stream sound failed." );
				return;
			}

			Init( null, mode, 100000.0f, channels, frequency );
		}
Example #4
0
		unsafe public DirectDataStreamSound( SoundMode mode, int channels, int frequency, int bufferSize,
			SoundWorld.DataReadDelegate dataReadCallback )
		{
			this.dataReadCallback = dataReadCallback;
			this.creationBufferSize = bufferSize;

			waveFormat = (WAVEFORMATEX*)NativeUtils.Alloc( NativeMemoryAllocationType.SoundAndVideo,
				sizeof( WAVEFORMATEX ) );
			NativeUtils.ZeroMemory( (IntPtr)waveFormat, sizeof( WAVEFORMATEX ) );
			waveFormat->wFormatTag = DSound.WAVE_FORMAT_PCM;
			waveFormat->nChannels = (ushort)channels;
			waveFormat->nSamplesPerSec = (uint)frequency;
			waveFormat->wBitsPerSample = 16;
			waveFormat->nBlockAlign = (ushort)( ( waveFormat->nChannels * waveFormat->wBitsPerSample ) / 8 );
			waveFormat->nAvgBytesPerSec = waveFormat->nSamplesPerSec * waveFormat->nBlockAlign;

			Init( null, mode, 100000.0f, channels, frequency );
		}