Visualizzazione dei risultati da 1 a 6 su 6
  1. #1
    Utente di HTML.it
    Registrato dal
    Sep 2011
    Messaggi
    11

    Alterare la riproduzione di un Wav......

    salve a tutti, da un po' di tempo sto cercando di modificare la riproduzione di un file .wav che salvo dopo una registrazione fatta del mic. in modo che sia più acuto o meno. controllando il tutto con una trackbar.....è possibile farlo??

    codice:

    importo la libreria :
    codice:
    Imports System.Runtime.InteropServices
    e
    codice:
        <DllImport("winmm.dll", SetLastError:=False, ExactSpelling:=True)> _ Public Shared Function mciSendStringA(ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer     End Function
    codice per registrare :
    codice:
            
    mciSendStringA("open new Type waveaudio Alias registrazione", "", 0, 0)         mciSendStringA("record registrazione", "", 0, 0)
    salvo e riproduco :
    codice:
            
    mciSendStringA("save registrazione c:\mvoice.wav", "", 0, 0)         
    mciSendStringA("close registrazione", "", 0, 0)        
     My.Computer.Audio.Play("c:\mvoice.wav")
    grazie

  2. #2
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,481
    E quindi?

    Per modificare un wav come dici tu bisogna rielaborarne i pacchetti digitali acquisiti.

    Non è affatto semplice ricalcolare tali pacchetti e reinserirli al posto giusto.

    Sicuramente dovrai utilizzare librerie apposite.
    No MP tecnici (non rispondo nemmeno!), usa il forum.

  3. #3
    Utente di HTML.it
    Registrato dal
    Sep 2011
    Messaggi
    11
    anche rallentare la riproduzione è così difficile ??

  4. #4
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,481
    Direi proprio di sì
    No MP tecnici (non rispondo nemmeno!), usa il forum.

  5. #5
    Utente di HTML.it
    Registrato dal
    Sep 2011
    Messaggi
    11
    cercando su internet ho trovato questo codice che modifica la velocità della riproduzione del file...... unico problema è che non so tradurlo in vb.net potete darmi una mano??
    codice:
    Option Explicit
    Private Type RIFF
        riffId As String * 4
        riffLen As Long
        riffType As String * 4
    End Type
    Private Type RIFF_CHUNK
        chunkId As String * 4
        chunkLen As Long
    End Type
    Private Type WAVEFORMAT
        wFormatTag As Integer
        nChannels As Integer
        nSamplesPerSec As Long
        nAvgBytesPerSec As Long
        nBlockAlign As Integer
        wBitsPerSample As Integer
    End Type
    
    Private Sub Form_Load()
    
        'make a copy of 'The Microsoft Sound'
        FileCopy "C:\Windows\Media\The Microsoft Sound.wav", "C:\WaveFast.wav"
        'increase the speed of this wave file
        SpeedUp "C:\WaveFast.wav"
        
        'make another copy of 'The Microsoft Sound'
        FileCopy "C:\Windows\Media\The Microsoft Sound.wav", "C:\WaveSlow.wav"
        'decrease the speed of this wave file
        SpeedDown "C:\WaveSlow.wav"
        
        Unload Me
    End Sub
    
    Sub SpeedUp(WaveFile As String)
        Dim nFile As Integer
        nFile = FreeFile
        Dim r As RIFF, fmt As RIFF_CHUNK, wf As WAVEFORMAT
        Open WaveFile For Binary As #nFile
        Get #nFile, , r     'the 'RIFF' header
        Get #nFile, , fmt   'the 'fmt ' chunk
        Get #nFile, , wf    'the WAVEFORMAT header
        'increase the sample rate
        wf.nSamplesPerSec = wf.nSamplesPerSec * 2
        wf.nAvgBytesPerSec = wf.nAvgBytesPerSec * 2
        'write back the WAVEFORMAT structure to the file
        Put #nFile, Seek(nFile) - Len(wf), wf
        'close the file
        Close nFile
    End Sub
    
    Sub SpeedDown(WaveFile As String)
        Dim nFile As Integer
        nFile = FreeFile
        Dim r As RIFF, fmt As RIFF_CHUNK, wf As WAVEFORMAT
        Open WaveFile For Binary As #nFile
        Get #nFile, , r     'the 'RIFF' header
        Get #nFile, , fmt   'the 'fmt ' chunk
        Get #nFile, , wf    'the WAVEFORMAT header
        'decrease the sample rate
        wf.nSamplesPerSec = wf.nSamplesPerSec / 2
        wf.nAvgBytesPerSec = wf.nAvgBytesPerSec / 2
        'write back the WAVEFORMAT structure to the file
        Put #nFile, Seek(nFile) - Len(wf), wf
        'close the file
        Close nFile
    End Sub

  6. #6
    Moderatore di Programmazione L'avatar di LeleFT
    Registrato dal
    Jun 2003
    Messaggi
    17,328

    Moderazione

    Richieste di questo tipo sono di competenza del forum "Offro Lavoro / Collaborazione", non essendo propriamente problematiche di "programmazione", quanto piuttosto di traduzione e rielaborazione di un listato da un linguaggio ad un altro.

    Devo chiudere.


    Ciao.
    "Perchè spendere anche solo 5 dollari per un S.O., quando posso averne uno gratis e spendere quei 5 dollari per 5 bottiglie di birra?" [Jon "maddog" Hall]
    Fatti non foste a viver come bruti, ma per seguir virtute e canoscenza

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.