با سلام میخواستم بدونم چطور میشه صدا را مثلا از میکروفون وگوشی یک تلفن بر روی یک هارد ideیا sata یا یک حافظه با حجم بالا ضبط کردالبته با زمان وتاریخ و ÷خش هرکدوم با دادن آدرس زمان وتاریخ اگر میتوانید لطفا کمک کنید
اطلاعیه
Collapse
No announcement yet.
ضبط صدا
Collapse
X
-
پاسخ : ضبط صدا
نوشته اصلی توسط khast khodaiebehnamچیا جان به خدا برنامه همراهم نیس کافی نتم
به محض وقت کردن چشم
با چه زبانی نوشتید؟ِِDie for Life, Not Live to Die
Freedom Fighter
" ناخود گاه، هریک از ما ، از نامیرائی خود یقین دارد " . فروید
دیدگاه
-
پاسخ : ضبط صدا
سلام شرمنده
اینم چیزسی که قول داده بودم
÷خشو ضبط فقط با یه میکرو خودم ساختم و تست کردمش
$regfile = "m8def.dat"
$prog &HFF , &H7F , &HD9 , &H00 ' generated. Take care that the chip supports all fuse bytes.$regfile = "M8def.dat"
$crystal = 16000000 ' generated. Take care that the chip supports all fuse bytes.000000
$baud = 9600
'$PROG &HFF,&HFF,&HD9,&H00' generated. Take care that the chip supports all fuse bytes.
'-------------------------- MMC Pin Configuration ------------------------------
' Change this pin configuration if it is necessary in your project.
Cs Alias Portb.2 : Config Pinb.2 = Output 'Connected to Pin No.1 Of MMC (CS)
Mosi Alias Portb.3 : Config Pinb.3 = Output 'Connected to Pin No.2 Of MMC (DataIn)
Clk Alias Portb.5 : Config Pinb.5 = Output 'Connected to Pin No.5 Of MMC (Clock)
Miso Alias Pinb.4 : Config Pinb.4 = Input
Config Portc.5 = Output
Led Alias Portc.5
'---------------------------- MMC Var. Define ----------------------------------
' MMC function declarations and variables.
' DONT TOUCH THIS PART!!!
Config Pind.2 = Input
Config Pind.3 = Input
Declare Sub Mmc_init
Declare Sub Mmc_status
Dim Mmc_buffer(512) As Byte
Dim Sector_pointer As Word
Dim Free_counter As Word
Dim Sector_number As Long
Dim Addr As Long
Dim Mmc_dat As Byte
Dim Mmc_resp As Byte
Dim Mmc_resp2 As Word
Dim Y As Byte
Dim Shomare1 As Eram Long
Dim Shomare2 As Eram Long
Dim Shomare22n As Long
Dim I As Word
Dim V As Byte
Dim Safe As Eram Byte
Dim T As Byte
Dim S As String * 70
Dim D As String * 70
Dim Dd As String * 1
Dim Ss As String * 1
Dim Idx As Byte
Dim My_counter As Integer
Dim In_char As String * 1
Dim A As Byte
Const Msbl = 0 : Const Msbh = 1
Const Spidelay = 5
'-----------------------adc and timer------------------------------------------
Enable Interrupts
Config Adc = Single , Prescaler = 16 , Reference = Internal
Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Up , Prescale = 1
Wait 1
Mmc_init
'----------------------- Your Functions Declarations ---------------------------
' Write Your Functions Declarations Here:
'-------------------------------------------------------------------------------
'-------------------------------- M A I N --------------------------------------
If Mmc_resp2 <> 0 Then
For A = 1 To 5
Toggle Led
Wait 1
Next A
End If
T = Safe
Waitms 4
If T < 50 Then
Safe = 50
Waitms 4
End If
Incr T
Safe = T
Waitms 4
Print T
'If T > 11 Then Goto Laince
Shomare22n = Shomare1
Waitms 4
If Shomare22n < 50 Then
Shomare22n = 1100 '\/\/\/\/\/\/\/\/\/\/\
Shomare1 = Shomare22n
Print "shomare 1 has been chenged"
End If
Shomare22n = Shomare2
Waitms 4
If Shomare22n < 50 Then
Shomare22n = 1100 '/\/\/\/\/\/\/\/\/\/\/
Shomare2 = Shomare22n
Print "shomare 2 has been chenged"
End If
Sector_number = Shomare2
Waitms 4
Ss:
If Sector_number > 941000 Then
For A = 1 To 5
Toggle Led
Wait 1
Next A
Goto Laince
End If
A = 0
T = 0
Reset Led
Do
If Pind.2 = 0 Then Goto Recstar
If Pind.3 = 0 Then Goto Readstar
Incr A
If A > 253 Then
Incr T
If T > 200 Then
A = 0
T = 0
Toggle Led
End If
End If
Loop
Restart:
If Pind.2 = 0 And Pind.3 = 0 Then
Waitms 620
Toggle Led
Shomare2 = 1100
Waitms 4
Shomare1 = 1100
Waitms 4
Print "restarting in procses"
Waitms 550
Toggle Led
End If
Waitms 600
Toggle Led
Return
'--------------------------------- E N D ---------------------------------------
'------------------------------- Functions -------------------------------------
'-------------------------------------------------------------------------------
' Write your functions here :
'-------------------------------------------------------------------------------
'---------------------------- Initializing MMC ---------------------------------
Sub Mmc_init
Print "--Start Initializing MMC ..."
Set Portb.1
Set Cs
Mmc_dat = &HFF
For Free_counter = 1 To 10
Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Next Free_counter
Mmc_resp = 255
Print "--Command No.=0"
Reset Cs
'40 dar asl argooman ast
'yani bite aval 0(start)bit 2vom(1){safhey 473 va 474 ketab}va 6 bit cmd ast}
Cmd0:
Mmc_dat = &H40 : Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay '8 bite avval
Addr = 0 : Shiftout Mosi , Clk , Addr , Msbl , 32 , Spidelay '32 bit argooman
Mmc_dat = &H95 : Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay 'crc(tashkise khata)
While Mmc_resp <> &H01 'mitoni inja beshmari bebini chand ta klock mizaneh
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
Wend
Print "--Command Response :" ; Hex(mmc_resp)
Set Cs
Waitms 50
Print "--Command No.=1"
Reset Cs
Mmc_dat = &HFF
Cmd1:
While Mmc_resp <> &H00
Set Cs
Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
Reset Cs
Mmc_dat = &H41 : Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Addr = 0 : Shiftout Mosi , Clk , Addr , Msbl , 32 , Spidelay
Mmc_dat = &HFF : Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
Wend
Mmc_dat = &HFF
Set Cs
Print "--Command Response :" ; Hex(mmc_resp)
Print ""
Mmc_status '***************************chek for status
Print "--Initialize Complete."
End Sub
'-------------------------- MMC Initializing END -------------------------------
'-------------------------------------------------------------------------------
'---------------------------- Read MMC Status ----------------------------------
Sub Mmc_status
Cmd13:
Set Cs
Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
Reset Cs
Mmc_dat = &H4D : Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay 'mmc dat=4d yani 4 ro bi khial d=13
'ya dakhele dastore cmd 1=mishe 41 va to cmd 0 mishe 40(yooohooo)
Addr = 0 : Shiftout Mosi , Clk , Addr , Msbl , 32 , Spidelay
Mmc_dat = &HFF : Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Shiftin Miso , Clk , Mmc_resp2 , Msbl , 8 , Spidelay
Print "" : Print "--Status :" ; Hex(mmc_resp2)
Set Cs
End Sub
'------------------------------- Functions -------------------------------------
'-------------------------------------------------------------------------------
'******************************playing******* **********************************
'------------------------------- Functions -------------------------------------
'-------------------------------------------------------------------------------
Readstar:
Gosub Restart
Set Led
Print "playing......"
Sector_number = Shomare1
Shomare22n = Shomare2
Waitms 4
Waitms 4
Print Sector_number
'Shomare22 = Shomare2
'Waitms 4
Wait 1
Enable Oc1a
Do
Addr = Sector_number * 512
Set Cs
Mmc_dat = &HFF
Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
Cmd170:
Reset Cs
Mmc_dat = &H51 : Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Shiftout Mosi , Clk , Addr , Msbl , 32 , Spidelay
Mmc_dat = &HFF : Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
While Mmc_resp <> 0
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
Wend
While Mmc_resp <> &HFE
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
Wend
For Sector_pointer = 1 To 512
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
Mmc_buffer(sector_pointer) = Mmc_resp
Pwm1a = Mmc_resp
Waitus 35 '\/\/\/\/\delay for play
Next Sector_pointer
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
Set Cs
Incr Sector_number
If Sector_number = Shomare22n Then Exit Do
Loop Until Pind.3 = 0
Disable Oc1a
Print "finishing........."
Wait 1
Reset Led
Goto Ss
'------------------------------- end Functions --------------------------------
'-------------------------------------------------------------------------------
'------------------------------- Functions -------------------------------------
'-------------------------------------------------------------------------------
'*********************************recording** ***********************************
'------------------------------- Functions -------------------------------------
'-------------------------------------------------------------------------------
Recstar:
Gosub Restart
Set Led
Sector_number = Shomare2
Waitms 4
Print Sector_number
Shomare1 = Sector_number
Waitms 4
Print "shomare1 and sector number"
Print Sector_number
Pwm1a = 0
Disable Oc1a
Start Adc
Wait 1
Do
Addr = Sector_number * 512
Set Cs
Mmc_dat = &HFF : Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
Cmd24:
Reset Cs
Mmc_dat = &H58 : Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Shiftout Mosi , Clk , Addr , Msbl , 32 , Spidelay
Mmc_dat = &HFF : Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
While Mmc_resp <> 0
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
Wend
Mmc_dat = &HFE : Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
For Sector_pointer = 1 To 512
Mmc_buffer(sector_pointer) = Getadc(0)
Mmc_dat = Mmc_buffer(sector_pointer)
Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Next Sector_pointer
Mmc_dat = &HFF : Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Mmc_dat = &HFF : Shiftout Mosi , Clk , Mmc_dat , Msbl , 8 , Spidelay
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
While Mmc_resp = 0
Shiftin Miso , Clk , Mmc_resp , Msbl , 8 , Spidelay
Wend
Set Cs
Incr Sector_number
If Sector_number > 941000 Then Exit Do
Loop Until Pind.2 = 0
Stop Adc
Shomare2 = Sector_number
Waitms 5
Print "shomare2"
Print Sector_number
Wait 1
Reset Led
Goto Ss
'------------------------------- end Functions --------------------------------
'-------------------------------------------------------------------------------
'------------------------------- end Functions --------------------------------
'-------------------------------------------------------------------------------
Laince:
Do
Loop
ببخشید که به هم ریختس در عوض 100%عملیهعلم چندانکه بیشتر خوانی چون عمل در تو نیست نادانی
دیدگاه
دیدگاه