Open ghost opened 3 years ago
Nope, haven't tested, but it should be possible to do with torch::fromDlPack or torch::from_blob.
The current version isn't well tested, need to unroll some commits. And even then, I have an example of access violation. So take this as a code primer, not stable codebase
Also, if you need to just read audio without effects, then using sws_scale for resampling directly may be simpler: https://github.com/ac000/ffmpeg-libs-audio-transcode/blob/master/transcode.c#L146
Thanks! I shall give it a try and get back to you.
Also, for such usecase, there is probably no need of going through DLPack, and you can fill the tensor directly
Hello, Did you test it with torch::tensor? I mean were you able to read a wav file into a C++ torch::tensor?