Модераторы: Daevaorn
  

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Модуль записи с микрофона в файл, Помогите!!!! Срочно нужен Модуль записи 
:(
    Опции темы
Окса
  Дата 8.6.2002, 16:55 (ссылка)    |    (голосов: 0) Загрузка ... Загрузка ... Быстрая цитата Цитата


Unregistered











Пожалуйста!!! Если кто-то знает: как записать звук с микрофона в файл, а потом вывести на колонки???
Есть ли стандартные функции или разработанные модули? Нужен исходный текст на С++. Может, кто-то сам увлекался?[email protected] :laugh
  Вверх
Vit
Дата 8.6.2002, 17:00 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Vitaly Nevzorov
****


Профиль
Группа: Экс. модератор
Сообщений: 10964
Регистрация: 25.3.2002
Где: Chicago

Репутация: нет
Всего: 207



Есть пример на Дельфи:

http://www.forum.vingrad.ru/cgi-bin....hl=звук


--------------------
With the best wishes, Vit
I have done so much with so little for so long that I am now qualified to do anything with nothing
Самый большой Delphi FAQ на русском языке здесь: www.drkb.ru
PM MAIL WWW ICQ   Вверх
Baa
Дата 8.6.2002, 22:30 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Экс. модератор
Сообщений: 2639
Регистрация: 12.4.2002
Где: Москва

Репутация: 8
Всего: 12



либо через MCI, либо
If the MCI waveform-audio recording services do not meet the specifications of your application, you can handle waveform-audio recording using the waveform-audio services. For more information, see MCI.

Waveform-Audio Input Data Types

The following data types are defined for waveform-audio input functions:

Type Description
HWAVEIN Handle of an open waveform-audio input device.
WAVEFORMATEX Structure that specifies the data formats supported by a particular waveform-audio input device. This structure is also used for waveform-audio output devices.
WAVEHDR Structure used as a header for a block of waveform-audio input data. This structure is also used for waveform-audio output devices.
WAVEINCAPS Structure used to inquire about the capabilities of a particular waveform-audio input device.


Querying Waveform-Audio Input Devices

Before recording waveform audio, you should call the waveInGetDevCaps function to determine the waveform-audio input capabilities of the system. This function fills a WAVEINCAPS structure with information about the capabilities of a specified device. This information includes the manufacturer and product identifiers, a product name for the device, and the version number of the device driver. In addition, the WAVEINCAPS structure provides information about the standard waveform-audio formats that the device supports.

Opening Waveform-Audio Input Devices

Use the waveInOpen function to open a waveform-audio input device for recording. This function opens the device associated with the specified device identifier and returns a handle of the open device by writing the handle of a specified memory location.
Some multimedia computers have multiple waveform-audio input devices. Unless you know you want to open a specific waveform-audio input device in a system, you should use the WAVE_MAPPER constant for the device identifier when you open a device. The waveInOpen function will choose the device in the system best able to record in the specified data format.

Managing Waveform-Audio Recording

After you open a waveform-audio input device, you can begin recording waveform-audio data. Waveform-audio data is recorded into application-supplied buffers specified by a WAVEHDR structure. These data blocks must be prepared before they are used; for more information, see Audio Data Blocks.
Windows provides the following functions to manage waveform-audio recording.

Function Description
waveInAddBuffer Sends a buffer to the device driver so it can be filled with recorded waveform-audio data.
waveInReset Stops waveform-audio recording and marks all pending buffers as done.
waveInStart Starts waveform-audio recording.
waveInStop Stops waveform-audio recording.


Use the waveInAddBuffer function to send buffers to the device driver. As the buffers are filled with recorded waveform-audio data, the application is notified with a window message, callback message, thread message, or event, depending on the flag specified when the device was opened.
Before you begin recording by using waveInStart, you should send at least one buffer to the driver, or incoming data could be lost.
Before closing the device using waveInClose, call waveInReset to mark any pending data blocks as being done.

Using Window Messages to Manage Waveform-Audio Recording

The following messages can be sent to a window procedure function for managing waveform-audio recording.

Message Description
MM_WIM_CLOSE Sent when the device is closed by using the waveInClose function.
MM_WIM_DATA Sent when the device driver is finished with a buffer sent by using the waveInAddBuffer function.
MM_WIM_OPEN Sent when the device is opened by using the waveInOpen function.


The lParam parameter of MM_WIM_DATA specifies a pointer to a WAVEHDR structure that identifies the buffer. This buffer might not be completely filled with waveform-audio data; recording can stop before the buffer is filled. Use the dwBytesRecorded member of the WAVEHDR structure to determine the amount of valid data present in the buffer.
The most useful message is probably MM_WIM_DATA. When your application finishes using the data block sent by the device driver, you can clean up and free the data block. Unless you need to allocate memory or initialize variables, you probably do not need to use the MM_WIM_OPEN and MM_WIM_CLOSE messages.

The callback function for waveform-audio input devices is supplied by the application. For information about this callback function, see the waveInProc function.


--------------------
"Duty is everything; the greatest of joys, the deepest of sorrows" Aribeth de Tylmarande
PM ICQ   Вверх
Baa
Дата 8.6.2002, 22:32 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Экс. модератор
Сообщений: 2639
Регистрация: 12.4.2002
Где: Москва

Репутация: 8
Всего: 12



The MCI_RECORD command starts recording from the current position or from one specified location to another specified location. VCR and waveform-audio devices recognize this command. Although digital-video devices and MIDI sequencers also recognize this command, the MCIAVI and MCISEQ drivers do not implement it.

MCIERROR mciSendCommand(MCIDEVICEID wDeviceID, MCI_RECORD,  
   DWORD dwFlags, (DWORD) (LPMCI_RECORD_PARMS) lpRecord);


Parameters

wDeviceID

Device identifier of the MCI device that is to receive the command message.

dwFlags

MCI_NOTIFY, MCI_WAIT, or, for digital-video and VCR devices, MCI_TEST. For information about these flags, see The Wait, Notify, and Test Flags.

lpRecord

Address of an MCI_RECORD_PARMS structure. (Devices with extended command sets might replace this structure with a device-specific structure.)



Return Values

Returns zero if successful or an error otherwise.

Remarks

This command is supported by devices that return TRUE when you call the MCI_GETDEVCAPS command with the MCI_GETDEVCAPS_CAN_RECORD flag. For the MCIWAVE driver, all data recorded after a file is opened is discarded if the file is closed without saving it.
The following additional flags apply to all devices supporting MCI_RECORD:
MCI_FROM

A starting location is included in the dwFrom member of the structure identified by lpRecord. The units assigned to the position values are specified with the MCI_SET_TIME_FORMAT flag of the MCI_SET command. If MCI_FROM is not specified, the starting location defaults to the current position.

MCI_RECORD_INSERT

Newly recorded information should be inserted or pasted into the existing data. Some devices might not support this. If supported, this is the default.

MCI_RECORD_OVERWRITE

Data should overwrite existing data. The MCIWAVE.DRV device returns MCIERR_UNSUPPORTED_FUNCTION in response to this flag.

MCI_TO

An ending location is included in the dwTo member of the structure identified by lpRecord. The units assigned to the position values are specified with the MCI_SET_TIME_FORMAT flag of the MCI_SET command. If MCI_TO is not specified, the ending location defaults to the end of the content.



The following additional flags are used with the digitalvideo device type:
MCI_DGV_RECORD_AUDIO_STREAM

An audio-stream number is included in the dwAudioStream member of the structure identified by lpRecord. If you omit this flag, audio data is recorded into the first physical stream.

MCI_DGV_RECORD_HOLD

When recording stops, the screen will hold the last image and will not resume showing the video until an MCI_MONITOR command is issued.

MCI_DGV_RECORD_VIDEO_STREAM

A video-stream number is included in the dwVideoStream member of the structure identified by lpRecord. If you omit this flag, video data is recorded into the first physical stream.

MCI_DGV_RECT

A rectangle is specified in the rc member of the structure identified by lpRecord. The rectangle specifies the region of the external input used as the source for the pixels compressed and saved. This rectangle defaults to the rectangle specified (or defaulted) by the MCI_DGV_PUT_VIDEO flag for the MCI_PUT command. When it is set differently than the video rectangle, what is displayed is not what is recorded



For digital-video devices, lpRecord points to an MCI_DGV_RECORD_PARMS structure.
The following additional flags are used with the vcr device type:
MCI_VCR_RECORD_AT

The dwAt member of the structure identified by lpRecord contains a time when the entire command begins, or if the device is cued, when the device reaches the from position given by the cue command.

MCI_VCR_RECORD_INITIALIZE

Seek the device to the start of the media, begin recording blank video and audio, and record timecode, if possible.



For VCR devices, lpRecord points to an MCI_VCR_RECORD_PARMS structure.


--------------------
"Duty is everything; the greatest of joys, the deepest of sorrows" Aribeth de Tylmarande
PM ICQ   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Правила форума "С++:Общие вопросы"
Earnest Daevaorn

Добро пожаловать!

  • Черновик стандарта C++ (за октябрь 2005) можно скачать с этого сайта. Прямая ссылка на файл черновика(4.4мб).
  • Черновик стандарта C (за сентябрь 2005) можно скачать с этого сайта. Прямая ссылка на файл черновика (3.4мб).
  • Прежде чем задать вопрос, прочтите это и/или это!
  • Здесь хранится весь мировой запас ссылок на документы, связанные с C++ :)
  • Не брезгуйте пользоваться тегами [code=cpp][/code].
  • Пожалуйста, не просите написать за вас программы в этом разделе - для этого существует "Центр Помощи".
  • C++ FAQ

Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Earnest Daevaorn

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | C/C++: Общие вопросы | Следующая тема »


 




[ Время генерации скрипта: 0.0664 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.