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

Support converters for Wav & ? #23

Open
Teque5 opened this issue Sep 6, 2023 · 5 comments
Open

Support converters for Wav & ? #23

Teque5 opened this issue Sep 6, 2023 · 5 comments

Comments

@Teque5
Copy link
Collaborator

Teque5 commented Sep 6, 2023

A long time ago we decided against doing this when the repos all lived in SigMF, but we should re-assess.

At GRCon23 we discussed adding converters for common formats (not metadata formats like issue #14) to include wav and other common time-series formats. Which formats would we like?

@777arc
Copy link
Member

777arc commented Sep 8, 2023

Yep, IQEngine was planning to add converters, so they could either live in this repo or in the IQEngine repo. It would be all python-based converters and IQEngine would provide a page where someone can upload their non-sigmf recording and it will download the sigmf-meta. Then for folks with sensitive recordings they can simply run the python converters manually.

@Teque5
Copy link
Collaborator Author

Teque5 commented Sep 8, 2023

In my brain this will work like this(?):

# x is abc.wav, xyz.mp3, uvw.opus, qwe.flac
import sigmf
handle = sigmf.sigmffile.fromfile(x)
# handle now has interpreted metadata from the file, and checksum etc
samples = handle.read_samples()
handle.validate() # will pass correctly
# you can write this to sigmf archive or whatever
handle.toarchive('abc.sigmf')

If this looks good I could work up a demo pretty fast. I'm still unsure if we want to house such a converter in this repo, but it won't be that much code. There may be some lookup tables or other cumbersome things needed for the converters, but it might not be too bad.

@777arc
Copy link
Member

777arc commented Sep 8, 2023

Ideally there would be a python script someone can run, providing their original format as input and it generates the SigMF files

@Teque5
Copy link
Collaborator Author

Teque5 commented Sep 9, 2023

Ideally there would be a python script someone can run, providing their original format as input and it generates the SigMF files

This is trivial by using the entry_points in the setup.py, but that kind of fully automated implementation would have to make some guesses that might be tricky.

Imagine if someone converts a 2-channel wav file. Do we assume this is I, Q or just a 2 channel real file. What about a 3 or 4 channel wav?

@777arc
Copy link
Member

777arc commented Sep 9, 2023

I think each converter is going to have some params

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