Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Audio storage, stereo switching
#12
Easy example. Volume leve is used as byte indicator.


Code: (Select All)

ReDim Shared CodedSound(0) As Single

CodeSnd "Hi this is text example, this time volume level is used as byte - modulation. This maybe can be good between two computers, but not good for radio signal."

For i = 1 To UBound(CodedSound)
    _SndRaw CodedSound(i)
Next i

Print EncodeSnd



Sub CodeSnd (Text As String)
    ReDim CodedSound(Len(Text) * 100) As Single
    Dim As Long I, L, G
    SignalDuration = 100 'one signal amplitude lenght is 100 samples
    stp = 1 / 256
    For L = 1 To Len(Text)
        For G = 1 To 100
            CodedSound(I) = Asc(Text, L) * stp
            I = I + 1
        Next G
    Next L
End Sub

Function EncodeSnd$
    Dim As Long i, g, j
    Dim As Single s
    stp = 1 / 256
    For i = 1 To (UBound(CodedSound) \ 100)
        s = 0
        For g = i To i + 99
            s = s + CodedSound(j)
            j = j + 1
        Next g
        s = (s / 100) * 256
        e$ = e$ + Chr$(s)
    Next i
    EncodeSnd$ = e$
End Function


Reply


Messages In This Thread
Audio storage, stereo switching - by Petr - 02-18-2023, 09:21 PM
RE: Audio storage, stereo switching - by Petr - 02-20-2023, 08:26 PM
RE: Audio storage, stereo switching - by Petr - 01-18-2025, 04:47 PM
RE: Audio storage, stereo switching - by bplus - 01-18-2025, 07:59 PM
RE: Audio storage, stereo switching - by Petr - 01-18-2025, 08:48 PM
RE: Audio storage, stereo switching - by bplus - 01-18-2025, 08:50 PM
RE: Audio storage, stereo switching - by Petr - 01-18-2025, 09:03 PM
RE: Audio storage, stereo switching - by Petr - Yesterday, 08:56 PM
RE: Audio storage, stereo switching - by Petr - 11 hours ago



Users browsing this thread: 4 Guest(s)