비주얼 베이식에서 웨이브 정보 추출

[CODE type=vb] Public Type wave_header wavRIFFChunk As String * 4 wavSize As Long wavWaveChunk As String * 4 wavFMTChunk As String * 4 wavFormatSize As Long wavPCMFormatFlag As Integer wavChannel As Integer wavSampleRate As Long wavSampleRatePerSec As Long wavPerSecScale As Integer wavBits As Integer wavDataChunk As String * 4 wavDataSize As Long End Type Open txtFile1.Text For Binary As #1 Get #1, , openFile1 If openFile1.wavPCMFormatFlag <> 1 Then MsgBox "표준 PCM 웨이브 파일이 아닙니다.", vbOKOnly + vbInformation, "확인" Close #1 txtFile1.Text = "" Exit Sub End If MCI.Command = "stop" MCI.Command = "close" tinfo = "RIFF Chunk : " & openFile1.wavRIFFChunk & vbCrLf & _ "Size : " & openFile1.wavSize & vbCrLf & _ "Wave Chunk : " & openFile1.wavWaveChunk & vbCrLf & _ "FMT Chunk : " & openFile1.wavFMTChunk & vbCrLf & _ "Format Size : " & openFile1.wavFormatSize & vbCrLf & _ "PCM Format Flag : " & openFile1.wavPCMFormatFlag & vbCrLf & _ "Channels : " & openFile1.wavChannel & vbCrLf & _ "Sample Rate : " & openFile1.wavSampleRate & vbCrLf & _ "Sample Rate/sec : " & openFile1.wavSampleRatePerSec & vbCrLf & _ "Per sec Scale : " & openFile1.wavPerSecScale & vbCrLf & _ "Bits per Sample : " & openFile1.wavBits & vbCrLf & _ "Data Chunk : " & openFile1.wavDataChunk & vbCrLf & _ "Data Size : " & openFile1.wavDataSize lblInformation1.Caption = tinfo zNumSample1 = openFile1.wavDataSize / (openFile1.wavChannel * (openFile1.wavBits / 8)) lblWating1.Visible = True DoEvents ReDim WaveData1(openFile1.wavChannel, zNumSample1) 'reading data For i = 0 To zNumSample1 - 1 For j = 0 To openFile1.wavChannel - 1 If openFile1.wavBits = 8 Then Get #1, , sdata8 WaveData1(j, i) = sdata8 Else Get #1, , sdata16 WaveData1(j, i) = sdata16 End If Next Next lblWating1.Visible = False Close #1 [/CODE]
Posted by 인생을설계하는 프로그래머

Where's my App.Path in VB.NET?


ID: 1064
Author: Abstractvb.com
Date: 9/15/2002 12:59:10 PM
VB.NET

Description

The APP Object no longer exists in VB.NET, so calling App.Path to get the location of your application does not work. Thankfully there are many other ways to do this in VB.NET, here are a few.

NOTE: Some of these will only work for forms and not DLL's without any UI. The first two that reference the System.Windows.Forms namespace will not work in a DLL with no UI.

Code

Here are a few examples: (I'm sure there are more.)

System.Windows.Forms.Application.ExecutablePath
System.Windows.Forms.Application.StartupPath
System.AppDomain.CurrentDomain.BaseDirectory()
System.GetEntryAssembly().Location

Posted by 인생을설계하는 프로그래머
이전페이지 1 다음페이지