» »

C# zvok

C# zvok

Loaded ::

lp

rad bi predvajal kratke mp3 datoteke na nek event. stvar deluje, ko se event prvič sproži, potem pa ne več.

razred zvok
[code]
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
//using System.Linq;
using System.Text;

namespace GlobalHookDemo
{
class Zvok
{
private string _command;
private bool isOpen;

[DllImport("winmm.dll")]
private static extern long mciSendString(string strCommand, StringBuilder strReturn, int iReturnLength, IntPtr hwndCallback);

public Zvok() { }

public void Close()
{
_command = "close MediaFile";
mciSendString(_command, null, 0, IntPtr.Zero);
isOpen = false;
}

public void Open(string sFileName)

{
_command = "open \"" + sFileName + "\" type mpegvideo alias MediaFile";
mciSendString(_command, null, 0, IntPtr.Zero);
isOpen = true;
}

public void Play(bool loop)
{
if(isOpen)
{
_command = "play MediaFile";
if (loop)
_command += " REPEAT";
mciSendString(_command, null, 0, IntPtr.Zero);
}
}
}
}
[/code]

tu pa še kako kličem.
[code]
zvok.Open("C:/krneki.mp3");
zvok.Play(false);
[/code]
Loadeed

Loaded ::

Če dam tole
zvok.Open("C:/krneki.mp3");
zvok.Play(false);
zvok.Close();
mi ga sploh ne predvaja...
Loadeed

Loaded ::

ok sem že popravil..
Loadeed

Zgodovina sprememb…

  • spremenil: Loaded ()


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

[C#] Prehajanje na low level

Oddelek: Programiranje
71197 (953) krneki0001
»

[C#] pixel scan z Thread

Oddelek: Programiranje
121049 (831) perooo25
»

kako narediti program ki bere drugi program

Oddelek: Programiranje
465312 (3625) imagodei
»

video v c#

Oddelek: Programiranje
241458 (998) boss-tech
»

Vb6

Oddelek: Programiranje
101224 (1087) StratOS

Več podobnih tem