با سلام خدمت دوستان و سروران گرامی
دیروز یک مدار wav player بستم ولی متاسفانه یک لرزشی در صدای پخش شده وجود دارد که از کیفیت کار کم می کنه.
ممنون میشم که برای حل این مشکل منو راهنمایی کنید.. (برای تقویت از LM386N-1 استفاده کردم ولی درست نشد . فقط صدا تقویت شد ولی همان لرزش در صدای پخش شده باز وجود دارد)
کد نوشته شده هم به شکل زیر می باشد.
$regfile = "m128def.dat"
$crystal = 11059200
$hwstack = 128
$swstack = 128
$framesize = 128
$baud = 9600
Enable Interrupts
Config Adc = Single , Prescaler = Auto , Reference = Internal
Config Clock = Soft
Config Date = Dmy , Separator = .
Time$ = "20
00"
Date$ = "16.04.08"
Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Up , Compare B Pwm = Clear Down , Prescale = 1
Pwm1a = 255
Pwm1b = 255
Config Com1 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0
Config Serialin = Buffered , Size = 64
Config Serialout = Buffered , Size = 64
Open "Com1:" For Binary As #1
Dim B As Byte
Dim S As String * 16
Dim Ff As Byte
Dim Serialstr As String * 64
Dim Serialstrbuff As String * 64
Dim Key As Byte
Dim L As Byte
Dim Resp As Byte
Dim Ss(10) As String * 16
Dim Diskf As Long
Dim Disks As Long
Dim Acc As Long
Dim Accc As Long
Dim I As Integer
Dim Track As Integer
Declare Sub Getline(s As String)
Declare Sub Flushbuf()
Print #1 , "Wait for Drive"
$include "Config_MMC.bas"
If Gbdriveerror <> 0 Then
End
End If
$include "Config_AVR-DOS.BAS"
Ff = Drivereset()
Ff = Driveinit()
$external Waitms
B = Initfilesystem(1)
If B <> 0 Then
End
End If
S_point:
Do
Serialstr = ""
Getline Serialstr
Serialstrbuff = ".wav"
I = Instr(serialstr , Serialstrbuff)
If I > 0 Then
Print Serialstrbuff
Goto Playe_file
End If
Loop
Playe_file:
Track = 0
S = ""
S = Dir(serialstr)
While Len(s) <> 0
Incr Track
Ss(track) = S
S = Dir()
Wend
For I = 1 To Track
Ff = Freefile()
Open Ss(i) For Binary As #ff
Do
Get #ff , Resp
Pwm1a = Resp
Pwm1b = Resp
' Waitus 3
Loop Until Eof(#ff) <> 0
Close #ff
Next
Goto S_point
'============================================ ===================================
Sub Getline(s As String)
S = ""
Do
Key = Inkey()
If Key <> 10 And Key <> 13 And Key <> 2 And Key <> 0 Then
S = S + Chr(key)
End If
If Key = 13 And Len(s) >= 1 Then
Flushbuf
Exit Do
End If
If Key = 0 And Len(s) = 0 Then
Exit Do
End If
Loop
End Sub
'============================================ ===================================
Sub Flushbuf()
Waitms 100
Do
Key = Inkey()
Loop Until Key = 0
End Sub
دیروز یک مدار wav player بستم ولی متاسفانه یک لرزشی در صدای پخش شده وجود دارد که از کیفیت کار کم می کنه.
ممنون میشم که برای حل این مشکل منو راهنمایی کنید.. (برای تقویت از LM386N-1 استفاده کردم ولی درست نشد . فقط صدا تقویت شد ولی همان لرزش در صدای پخش شده باز وجود دارد)
کد نوشته شده هم به شکل زیر می باشد.
$regfile = "m128def.dat"
$crystal = 11059200
$hwstack = 128
$swstack = 128
$framesize = 128
$baud = 9600
Enable Interrupts
Config Adc = Single , Prescaler = Auto , Reference = Internal
Config Clock = Soft
Config Date = Dmy , Separator = .
Time$ = "20

Date$ = "16.04.08"
Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Up , Compare B Pwm = Clear Down , Prescale = 1
Pwm1a = 255
Pwm1b = 255
Config Com1 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0
Config Serialin = Buffered , Size = 64
Config Serialout = Buffered , Size = 64
Open "Com1:" For Binary As #1
Dim B As Byte
Dim S As String * 16
Dim Ff As Byte
Dim Serialstr As String * 64
Dim Serialstrbuff As String * 64
Dim Key As Byte
Dim L As Byte
Dim Resp As Byte
Dim Ss(10) As String * 16
Dim Diskf As Long
Dim Disks As Long
Dim Acc As Long
Dim Accc As Long
Dim I As Integer
Dim Track As Integer
Declare Sub Getline(s As String)
Declare Sub Flushbuf()
Print #1 , "Wait for Drive"
$include "Config_MMC.bas"
If Gbdriveerror <> 0 Then
End
End If
$include "Config_AVR-DOS.BAS"
Ff = Drivereset()
Ff = Driveinit()
$external Waitms
B = Initfilesystem(1)
If B <> 0 Then
End
End If
S_point:
Do
Serialstr = ""
Getline Serialstr
Serialstrbuff = ".wav"
I = Instr(serialstr , Serialstrbuff)
If I > 0 Then
Print Serialstrbuff
Goto Playe_file
End If
Loop
Playe_file:
Track = 0
S = ""
S = Dir(serialstr)
While Len(s) <> 0
Incr Track
Ss(track) = S
S = Dir()
Wend
For I = 1 To Track
Ff = Freefile()
Open Ss(i) For Binary As #ff
Do
Get #ff , Resp
Pwm1a = Resp
Pwm1b = Resp
' Waitus 3
Loop Until Eof(#ff) <> 0
Close #ff
Next
Goto S_point
'============================================ ===================================
Sub Getline(s As String)
S = ""
Do
Key = Inkey()
If Key <> 10 And Key <> 13 And Key <> 2 And Key <> 0 Then
S = S + Chr(key)
End If
If Key = 13 And Len(s) >= 1 Then
Flushbuf
Exit Do
End If
If Key = 0 And Len(s) = 0 Then
Exit Do
End If
Loop
End Sub
'============================================ ===================================
Sub Flushbuf()
Waitms 100
Do
Key = Inkey()
Loop Until Key = 0
End Sub
دیدگاه