Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

C# - Sound / WAV / MP3 abspielen

Empfohlene Antworten

Veröffentlicht

hallo!!!

ich such mir hier grad wieder nen wolf in der MSDN

...

wie kann ich denn unter C# einen beliebigen sound abspielen??? ist mir auch ganz egal, ob es ein systemsound ist... eine frei wählbare WAV oder MP3 datei... alles was ich will sind schallwellen...

wär toll, wenn mir da wer helfen könnt... (O:

...

es gibt übrigens ein neues forum... www.iqcracy.de ... (O:

da gibt es mehrere Möglichkeiten

am einfachsten geht es mit DirectX

1.

Verweis auf Microsoft.DirectX.AudioVideoPlayback.dll,

dann folgenden Code:

using Microsoft.DirectX.AudioVideoPlayback;

.

.

.

public void PlayAudioFile(string fileName)

{

Audio audio = new Audio(fileName);

audio.Play();

}

2.

einbinden einer win32-DLL

class Play

{

[DllImport("winmm.dll")]

public static extern void PlaySound(string filename, int module, int

flags);

static void Main(string[] args)

{

const int SND_SYNC = 0x0000;

const int SND_ASYNC = 0x0001;

const int SND_LOOP = 0x0008;

PlaySound(args[0], 0, SND_SYNC);

}

}

und für MP3-Dateien lege ich dir folgenden Thread ans Herz:

Klick

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.