Startseite ¦  was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews ¦  sonstiges
kylix ¦  tutorials ¦  online shop ¦  fotos ¦  Add&Win Gewinnspiel


Willkommen Gast. Bitte einloggen oder registrieren.
21.05.2012, 11:54:01
Übersicht Hilfe Suche Einloggen Registrieren

+  SwissDelphiCenter Forum
|-+  German Forums
| |-+  WinAPI Forum
| | |-+  WAV-Sound im Speicher
« vorheriges nächstes »
Seiten: [1] Drucken
Autor Thema: WAV-Sound im Speicher  (Gelesen 2609 mal)
Loïs Bégué
Global Moderator
Hero Member
*****
Offline Offline

Beiträge: 1718



WWW
« am: 17.03.2002, 12:57:25 »

Hi,

Kann man (und wenn ja, dann wie) eine Sound-Aufnahme statt als Datei im Speicher ablegen und von dort aus wieder abspielen.
Eine Anbindung zu einem MemoryStream bzw. einem Speicher-Buffer wäre klasse...

Das Problem: ich will nichts auf der Festplatte ablegen bzw. speichern, auch nicht als Temporärdatei.

THX for your advices...

Gruß
Gespeichert

Prof.Y
Arpoon
Thomas Stutz
Global Moderator
Hero Member
*****
Offline Offline

Beiträge: 1784



WWW
« Antworten #1 am: 19.03.2002, 10:19:35 »

Mit was für Funktionen nimmst du denn den Sound auf ?
Gespeichert

(¯`·._tom_.·´¯)

Tipp: Viele Antworten auf Fragen gibt's hier:
http://www.swissdelphicenter.ch/de/tipsuchen.php
Loïs Bégué
Global Moderator
Hero Member
*****
Offline Offline

Beiträge: 1718



WWW
« Antworten #2 am: 19.03.2002, 10:51:43 »

Ich hab's nicht mehr so genau im Kopf.
Es handelt sich um ein angefangenes Prog. aus den 50ern (oder so :o) an dem ich wieder gedacht habe. Ich möchte es bald nochmals angehen und fertig machen...muß die ZIP-Datei ausgraben...

Ich glaube, das war mit der mmSystem...

*Jesus, where are my neurons ?*
Gespeichert

Prof.Y
Arpoon
Thomas Stutz
Global Moderator
Hero Member
*****
Offline Offline

Beiträge: 1784



WWW
« Antworten #3 am: 19.03.2002, 11:11:57 »

Sehe grad keinen Weg, wie du mit mciSendCommand() einen Sound streamen kannst.

Vielleicht findest du aber eine Lösung in der msdn:

[a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/mmfunc_1xwk.asp" target="_blank"]http://msdn.microsoft.com/library/default....mmfunc_1xwk.asp[/a]
Gespeichert

(¯`·._tom_.·´¯)

Tipp: Viele Antworten auf Fragen gibt's hier:
http://www.swissdelphicenter.ch/de/tipsuchen.php
Lemy
Hero Member
*****
Offline Offline

Beiträge: 605



« Antworten #4 am: 19.03.2002, 15:07:36 »

PlaySound
The PlaySound function plays a sound specified by the given filename, resource, or system event. (A system event may be associated with a sound in the registry or in the WIN.INI file.)

BOOL PlaySound(
  LPCSTR pszSound,  
  HMODULE hmod,    
  DWORD fdwSound    
);
Parameters
pszSound
A string that specifies the sound to play. If this parameter is NULL, any currently playing waveform sound is stopped. To stop a non-waveform sound, specify SND_PURGE in the fdwSound parameter.
Three flags in fdwSound (SND_ALIAS, SND_FILENAME, and SND_RESOURCE) determine whether the name is interpreted as an alias for a system event, a filename, or a resource identifier. If none of these flags are specified, PlaySound searches the registry or the WIN.INI file for an association with the specified sound name. If an association is found, the sound event is played. If no association is found in the registry, the name is interpreted as a filename.

hmod
Handle to the executable file that contains the resource to be loaded. This parameter must be NULL unless SND_RESOURCE is specified in fdwSound.
fdwSound
Flags for playing the sound. The following values are defined. Value Meaning
SND_APPLICATION The sound is played using an application-specific association.
SND_ALIAS The pszSound parameter is a system-event alias in the registry or the WIN.INI file. Do not use with either SND_FILENAME or SND_RESOURCE.
SND_ALIAS_ID The pszSound parameter is a predefined sound identifier.
SND_ASYNC The sound is played asynchronously and PlaySound returns immediately after beginning the sound. To terminate an asynchronously played waveform sound, call PlaySound with pszSound set to NULL.
SND_FILENAME The pszSound parameter is a filename.
SND_LOOP The sound plays repeatedly until PlaySound is called again with the pszSound parameter set to NULL. You must also specify the SND_ASYNC flag to indicate an asynchronous sound event.
SND_MEMORY A sound event's file is loaded in RAM. The parameter specified by pszSound must point to an image of a sound in memory.
SND_NODEFAULT No default sound event is used. If the sound cannot be found, PlaySound returns silently without playing the default sound.
SND_NOSTOP The specified sound event will yield to another sound event that is already playing. If a sound cannot be played because the resource needed to generate that sound is busy playing another sound, the function immediately returns FALSE without playing the requested sound.
If this flag is not specified, PlaySound attempts to stop the currently playing sound so that the device can be used to play the new sound.
 
SND_NOWAIT If the driver is busy, return immediately without playing the sound.
SND_PURGE Sounds are to be stopped for the calling task. If pszSound is not NULL, all instances of the specified sound are stopped. If pszSound is NULL, all sounds that are playing on behalf of the calling task are stopped.
You must also specify the instance handle to stop SND_RESOURCE events.
 
SND_RESOURCE The pszSound parameter is a resource identifier; hmod must identify the instance that contains the resource.
SND_SYNC Synchronous playback of a sound event. PlaySound returns after the sound event completes.


Return Values
Returns TRUE if successful or FALSE otherwise.

Remarks
The sound specified by pszSound must fit into available physical memory and be playable by an installed waveform-audio device driver. PlaySound searches the following directories for sound files: the current directory; the Windows directory; the Windows system directory; directories listed in the PATH environment variable; and the list of directories mapped in a network. For more information about the directory search order, see the documentation for the OpenFile function.

If it cannot find the specified sound, PlaySound uses the default system event sound entry instead. If the function can find neither the system default entry nor the default sound, it makes no sound and returns FALSE.

Requirements
  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Mmsystem.h.
  Library: Use Winmm.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
Gespeichert
Thomas Stutz
Global Moderator
Hero Member
*****
Offline Offline

Beiträge: 1784



WWW
« Antworten #5 am: 19.03.2002, 16:11:30 »

@Loïs: Hast du diesen Tip schon angeschaut ?

[a href="http://www.swissdelphicenter.ch/de/showcode.php?id=132" target="_blank"]http://www.swissdelphicenter.ch/de/showcode.php?id=132[/a]
Gespeichert

(¯`·._tom_.·´¯)

Tipp: Viele Antworten auf Fragen gibt's hier:
http://www.swissdelphicenter.ch/de/tipsuchen.php
Loïs Bégué
Global Moderator
Hero Member
*****
Offline Offline

Beiträge: 1718



WWW
« Antworten #6 am: 19.03.2002, 16:37:26 »

@Lemy:Diese Funz kenn'i scho. Aber aus der Beschreibung habe ich es nicht geschaft herauszulesen, wie ich meine Wave-Aufnahme in einem Stream/Buffer abspeichern kann. Trozdem Danke ;-)

@Thomas:
Jetzt schon... Not bad...Auch im MSDN konnte ich einiges nachlesen...
Danke allemal !

Aber wie kriege ich es in einem *§%#& Stream oder Buffer :-((((
Ich suche immer noch DAS Ding in drei Code-Zeilen daß alles macht, inklusive die Vorwäsche und das Bügeln...

Ich glaube ich muß entweder mit waveInXXXXX(...) oder mmIOXXX(...) Funktionen arbeiten. Was für ein Kreuz ... :-[

Aber ich verliere nicht die Hoffnung, denn...siehe meine Signatur :o)
Gespeichert

Prof.Y
Arpoon
Seiten: [1] Drucken 
« vorheriges nächstes »
Gehe zu:  


Einloggen mit Benutzername, Passwort und Sitzungslänge

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006, Simple Machines LLC Prüfe XHTML 1.0 Prüfe CSS