Visual Basic, .NET, ASP, VBScript
 

   
   
     

Форум - Общий форум

Страница: 1 |

 

  Вопрос: Форматы MP3, WAV, MIDI, WMA Добавлено: 23.02.05 21:45  

Автор вопроса:  Vit | Web-сайт: www.home-soft.jino-net.ru
1. Как можно узнать свойства этих файлов? Ну, типа:
 - длительность
 - формат сжатия
 - частота
 - заголовок
 - артист
и т.п.

2. Как определить закончилось ли воспроизведение файла?

Для воспроизведения использую функцию mciSendString.
Для начала воспроизведения параметр "PLAY <alias>".
Пробовал использовать "PLAY <alias> WAIT", но он блокировал всё и освобождал прогу только после воспроизведения файла.

Ответить

  Ответы Всего ответов: 6  

Номер ответа: 1
Автор ответа:
 HACKER


 

Разработчик Offline Client

Вопросов: 236
Ответов: 8362
 Профиль | | #1 Добавлено: 23.02.05 21:54
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Declare Function mciGetErrorString Lib "winmm.dll" Alias "mciGetErrorStringA" (ByVal dwError As Long, ByVal lpstrBuffer As String, ByVal uLength As Long) As Long



Дайте описание этих функций! Желательно с прмерами!

Ответить

Номер ответа: 2
Автор ответа:
 LamerOnLine



ICQ: 334781088 

Вопросов: 108
Ответов: 2822
 Профиль | | #2 Добавлено: 24.02.05 09:49
Ну а чем тебе описание из MSDN не устраивает?

  
  Platform SDK: Windows Multimedia
mciSendString
The mciSendString function sends a command string to an MCI device. The device that the command is sent to is specified in the command string.

MCIERROR mciSendString(
  LPCTSTR lpszCommand,
  LPTSTR lpszReturnString,
  UINT cchReturn,
  HANDLE hwndCallback
);
Parameters
lpszCommand
Pointer to a null-terminated string that specifies an MCI command string. For a list, see Multimedia Command Strings.
lpszReturnString
Pointer to a buffer that receives return information. If no return information is needed, this parameter can be NULL.
cchReturn
Size, in characters, of the return buffer specified by the lpszReturnString parameter.
hwndCallback
Handle to a callback window if the "notify" flag was specified in the command string.
Return Values
Returns zero if successful or an error otherwise. The low-order word of the returned DWORD value contains the error return value. If the error is device-specific, the high-order word of the return value is the driver identifier; otherwise, the high-order word is zero. For a list of possible error values, see MCIERR Return Values.

To retrieve a text description of mciSendString return values, pass the return value to the mciGetErrorString function.

Requirements
  Windows NT/2000/XP: Included in Windows NT 3.1 and later.
  Windows 95/98/Me: Included in Windows 95 and later.
  Header: Declared in Mmsystem.h; include Windows.h.
  Library: Use Winmm.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP.

See Also
MCI Overview, MCI Functions, Command Strings, mciGetErrorString

Platform SDK Release: November 2001 What did you think of this topic?
Let us know. Order a Platform SDK CD Online
(U.S/Canada) (International)

 

Requirements
  Windows NT/2000/XP: Included in Windows NT 3.1 and later.
  Windows 95/98/Me: Included in Windows 95 and later.
  Header: Declared in Mmsystem.h; include Windows.h.
  Library: Use Winmm.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP.
See Also
MCI Overview, MCI Functions, Command Strings, mciGetErrorString


  
Platform SDK: Windows Multimedia
Multimedia Command Strings
The following command strings are used with multimedia.

break
capability
capture
close
configure
copy
cue
cut
delete
escape
freeze
index
info
list
load
mark
monitor
open
paste
pause
play
put
quality
realize
record
reserve
restore
resume
save
seek
set
setaudio
settimecode
settuner
setvideo
signal
spin
status
step
stop
sysinfo
undo
unfreeze
update
where
window

Platform SDK Release: November 2001 What did you think of this topic?
Let us know. Order a Platform SDK CD Online
(U.S/Canada) (International)


  
  Platform SDK: Windows Multimedia
mciGetErrorString
The mciGetErrorString function retrieves a string that describes the specified MCI error code.

BOOL mciGetErrorString(
  ;DWORD fdwError,
  LPTSTR lpszErrorText,
  UINT cchErrorText
);
Parameters
fdwError
Error code returned by the mciSendCommand or mciSendString function.
lpszErrorText
Pointer to a buffer that receives a null-terminated string describing the specified error.
cchErrorText
Length of the buffer, in characters, pointed to by the lpszErrorText parameter.
Return Values
Returns TRUE if successful or FALSE if the error code is not known.

Remarks
Each string that MCI returns, whether data or an error description, can be a maximum of 128 characters.

Requirements
  Windows NT/2000/XP: Included in Windows NT 3.1 and later.
  Windows 95/98/Me: Included in Windows 95 and later.
  Header: Declared in Mmsystem.h; include Windows.h.
  Library: Use Winmm.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP.

See Also
MCI Overview, MCI Functions, mciSendCommand, mciSendString

Platform SDK Release: November 2001 What did you think of this topic?
Let us know. Order a Platform SDK CD Online
(U.S/Canada) (International)

 

Requirements
  Windows NT/2000/XP: Included in Windows NT 3.1 and later.
  Windows 95/98/Me: Included in Windows 95 and later.
  Header: Declared in Mmsystem.h; include Windows.h.
  Library: Use Winmm.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP.
See Also
MCI Overview, MCI Functions, mciSendCommand, mciSendString

Ответить

Номер ответа: 3
Автор ответа:
 Neco



ICQ: 247906854 

Вопросов: 133
Ответов: 882
 Web-сайт: neco.pisem.net
 Профиль | | #3
Добавлено: 24.02.05 22:21
а по-моему, из всех этих mci нормального проигрывателя не забацать - будет как в той иллюстрации "как пишутся программы", где у дерева выпилена середина ствола, а чтоб оно не падало стоят подпорки под ветки.
Я это использую тока для мелочи, а для этого всё знать не обязательно, достаточно вот этого:
Private Sub OpenEng()
MSS "OPEN " & (EngSPath) & " ALIAS ENG", 0, 0, 0
End Sub
Private Sub PlayEng()
MSS "PLAY ENG FROM 100", 0, 0, 0
Debug.Print "&#209;&#234;&#224;&#231;&#224;&#235; ''&#192;&#237;&#227;&#235;&#232;&#233;&#241;&#234;&#232;&#233;''"
End Sub
Private Sub StopEng()
MSS "STOP ENG", 0, 0, 0
End Sub
Private Sub CloseEng()
MSS "CLOSE ENG", 0, 0, 0
End Sub

Private Sub OpenRus()
MSS "OPEN " & (RusSPath) & " ALIAS RUS", 0, 0, 0
End Sub
Private Sub PlayRus()
MSS "PLAY RUS FROM 100", 0, 0, 0
Debug.Print "&#209;&#234;&#224;&#231;&#224;&#235; ''&#208;&#243;&#241;&#241;&#234;&#232;&#233;''"
End Sub
Private Sub StopRus()
MSS "STOP RUS", 0, 0, 0
End Sub
Private Sub CloseRus()
MSS "CLOSE RUS", 0, 0, 0
End Sub

Гомен за кодировку, но в общем этот код у меня оглашает переключенный язык. Точнее, когда-то это делал, теперь я перешёл на speechapi.
А для воспроизведения музона использую fmod. Классная библия со множеством возможностей. И кстати, все параметры трека у неё же узнаешь...

Ответить

Номер ответа: 4
Автор ответа:
 Neco



ICQ: 247906854 

Вопросов: 133
Ответов: 882
 Web-сайт: neco.pisem.net
 Профиль | | #4
Добавлено: 24.02.05 22:29
- частота
- заголовок
- артист
Не понял, что есть заголовок - но в общем часть инфы есть в тэгах - это последние ~130 байт (для первой версии), а для второй - это гимор. Мыль вышлю класс. Не очень правда, но вроде рабочий...

Ответить

Номер ответа: 5
Автор ответа:
 Neco



ICQ: 247906854 

Вопросов: 133
Ответов: 882
 Web-сайт: neco.pisem.net
 Профиль | | #5
Добавлено: 24.02.05 22:36
Млин, да что такое - тока отвечу, как сходу ещё идея появляется.
Попытайся запускать процедуру с Play ... Wait в отдебном потоке. Счас точно не помню, но кажется у функции CreateThread один из параметров - адрес функции.

Ответить

Номер ответа: 6
Автор ответа:
 Sharp


Лидер форума

ICQ: 216865379 

Вопросов: 106
Ответов: 9979
 Web-сайт: sharpc.livejournal.com
 Профиль | | #6
Добавлено: 02.03.05 11:09
это последние ~130 байт (для первой версии)
128. Называется ID3v1, формат найти можно, например, на codenet.ru

Ответить

Страница: 1 |

Поиск по форуму



© Copyright 2002-2011 VBNet.RU | Пишите нам