Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio format #1

Open
i0x71 opened this issue Jun 21, 2021 · 8 comments
Open

audio format #1

i0x71 opened this issue Jun 21, 2021 · 8 comments

Comments

@i0x71
Copy link

i0x71 commented Jun 21, 2021

Hi,
Can you please tell me what fornat the example txt files are in ?
I am trying to use "arecord -t raw -f U8" and use unsigned 8 bit data but its not working.
Thanks

@eripe970
Copy link
Owner

Hey!

Hmm haven't used the "arecord" tool so not sure what the output is, the format is just floats that can be parsed by golang, like below, separated by new lines:

1.1
1.2
1.5
1.4

@i0x71
Copy link
Author

i0x71 commented Jun 22, 2021

In my case tge output is 8 but unsigned, so values are between 0 and 255

@eripe970
Copy link
Owner

Do you have an example of a file that you can't get to work?

@i0x71
Copy link
Author

i0x71 commented Jun 22, 2021

Yep, here is the output of "arecord -t raw -f FLOAT_LE"
Which produces
q.raw.gz
Float 32 bit Little Endian, Rate 8000 Hz, Mono

So far i tried converting sets of 8 bytes with binary.LittleEndian to float64 but that hasn't gotten anywhere.

Thanks

@i0x71
Copy link
Author

i0x71 commented Jun 22, 2021

Update:
I was able to convert that output to a float list, please see the attached.
Now i am getting
2021/06/22 19:12:31 http: panic serving 127.0.0.1:55964: runtime error: invalid memory address or nil pointer dereference
test.txt

@eripe970
Copy link
Owner

eripe970 commented Jun 23, 2021

What code are you trying to run with the file? Do you have an example (maybe it's the 10s sample that breaks if there isn't enough data points available).

@i0x71
Copy link
Author

i0x71 commented Jun 23, 2021

Ah, im tring advanced example with the attached file

@eripe970
Copy link
Owner

Aha! Let me check it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants