19 Commits
Author SHA1 Message Date
Alexander Köplinger 5c75d264a8 [System] Don't include AlsaDevice on xammac_net_4_5
(cherry picked from commit 79ad720d5d)
2017-04-18 23:11:23 +02:00
Nikolay Amiantov c6de69eb21 Find more libraries via dllmap (#4451)
This allows centralized configuration of library paths. For instance,
previously setting path to libgtk-x11-2.0 won't make all parts of Mono use
provided library.
2017-03-02 20:28:07 +01:00
Alexander Köplinger b03e606287 Remove ChangeLog files from the repo
They weren't updated in the last 6 years and aren't helpful anymore (e.g. by causing unrelated matches during git grep searches).
2016-01-29 19:17:06 +01:00
Stephen McConnel 328defdcde Zero out pointers to freed memory in AudioDevice
This fixes https://bugzilla.xamarin.com/show_bug.cgi?id=24109.
2014-10-28 12:10:43 -05:00
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 0694f62d2c [Fix] Advanced Linux Sound Architecture (ALSA) configuration in class AudioDevice.cs
Improve the configuration of the Alsa hardware parameters.
The buffer and chunk size are set to the best suitable size according to wave file
caracteristic, i.e., format, channel and sampling rate.

Add Alsa software parameter.
Alsa becomes in Ready State as soon as there is a data chunk in its ring buffer.
Alsa starts playing data as soon as its buffer is full.

Add a UnderRun recovery method while playing a sound. When a underRun occurs, Alsa
layer need to be re set to Ready State (by calling snd_pcm_prepare) and the data chunk
is re send to Alsa.

Signed-off-by: Florent Valette <[email protected]>
2012-10-25 17:27:08 +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
Miguel de Icaza 88636d4e04 Another warning gone
svn path=/trunk/mcs/; revision=113372
2008-09-18 00:35:13 +00:00
Gert Driesen 5033e8f789 * SoundPlayer.cs: Addded support for playing WAV files on Windows.
Fixed ctor (Stream) to allow null argument. In LoadFromUri, first
reset mstream to support resetting Stream to null. Support playing
default sound. Allow Stream to be set to null. Reset AudioData and
WaveData when new stream is loaded.
* Win32SoundPlayer.cs: Wrapper for PlaySound Win32 API.
* System.dll.sources: Added Win32SoundPlayer.cs.
* SoundPlayerTest.cs: Added trivial ctor tests. Added test for
Stream property.

svn path=/trunk/mcs/; revision=89112
2007-11-07 15:56:33 +00: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
Alan McGovern a51a113ea9 Patch for bug 81867
svn path=/trunk/mcs/; revision=81519
2007-07-06 21:11:28 +00:00
Miguel de Icaza 4a5ddc5967 2007-01-22 Miguel de Icaza <[email protected]>
* SoundPlayer.cs: Remove unused variables 

svn path=/trunk/mcs/; revision=71482
2007-01-22 22:20:21 +00:00
Sebastien Pouliot f16767f9d7 2006-12-22 Sebastien Pouliot <[email protected]>
* SoundPlayer.cs: Hide default public ctor (to please corcompare)
	* SystemSounds.cs: Add missing attribute and downgrade PlayLoop 
	visibility (to please corcompare)


svn path=/trunk/mcs/; revision=69943
2006-12-22 15:55:35 +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
Paolo Molaro dcaf118bdd Tue Dec 19 19:17:06 CET 2006 Paolo Molaro <[email protected]>
* SoundPlayer.cs, SystemSound.cs, SystemSounds.cs: first stubs
	and partial implementation.


svn path=/trunk/mcs/; revision=69767
2006-12-19 18:32:50 +00:00