Commit Graph
8 Commits
Author SHA1 Message Date
Sebastian Loncar 146be1e0f0 Update mcs/class/System/System.Media/AudioData.cs
Since this line is commented out:
int block_align = buffer [idx++] | (buffer [idx++] << 8);
you will ran into a "bits per sample" exception.
Adding the two increpements (idx+=2) will solve it.
2012-12-21 11:58:30 +01:00
Marek Safar 558a1f92ea Clean up some warnings 2012-11-12 09:54:53 +01:00
Florent Valette abd93594e8 [Fix] AudioData(wav) play performing badly under Linux
Fix bug and improve performance of audio data play methode :
- Read only wave/Au raw data from Stream unstead of the whole file
- Play Sound chunk by chunk (chunk size compute at AudioDevice.setFormat call)
this is the best size compute by alsa for the hardware (better than the 4kB arbitrary size)
- Fix the chunk size to play. For Alsa, this size is in fragment, a fragment is one sample per channel
- count the data which are really play by alsa (snd_pcm_writei return a fragment size) and the next
chunk from that count.

Signed-off-by: Florent Valette <[email protected]>
2012-10-25 17:46:28 +02:00
Florent Valette fadee51de1 [Fix] Support to wave sound file under linux
Some wave file had a 'fact' chunk in header's data.
This is specified for non-PCM format but some PCM wave sound file could have one.
These kind of file are played well by System.Media.SoundPlay on win32 system but no
sound is played at all on unix system because the 'data' chunk is not found. This
patch adds support for wave file which have this optional 'fact' chunk in header's data.
It's also read chunk data according to the chunk size.

Signed-off-by: Florent Valette <[email protected]>
2012-10-25 16:53:03 +02:00
Miguel de Icaza f48ceb9860 [System] Removal of the NET_2_0 in the source code
Modulo the GUID in the assembly and the GUID embedded in some
field initializers that use the assembly GUID for their name, the
assemblies are idential before and after the patch.
2012-06-02 13:16:40 -04:00
Sebastien Pouliot 2bd20642d9 2007-11-06 Sebastien Pouliot <[email protected]>
* AudioData.cs: Reset stream to position 0 before playing (required
	when playing the audio in a loop). Part of the fix for bug #338991.
	* SoundPlayer.cs: Only create the AudioData once (and reuse it).
	Part of the fix for bug #338991.


svn path=/trunk/mcs/; revision=89027
2007-11-06 20:35:57 +00:00
Miguel de Icaza b89acb5391 Remove warning
svn path=/trunk/mcs/; revision=86641
2007-09-29 19:10:10 +00:00
Paolo Molaro 3916bd640e Wed Dec 20 18:26:36 CET 2006 Paolo Molaro <[email protected]>
* AudioData.cs, AudioDevice.cs: small (alsa) audio device and
	Wav file parsing implementation.
	* SoundPlayer.cs, SystemSound.cs: implemented most of the methods.


svn path=/trunk/mcs/; revision=69824
2006-12-20 17:29:06 +00:00