We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I do it in this way:
func concat(files [][]byte) ([]byte, error) { if len(files) == 1 { return files[0], nil } r, err := wav.NewReader(bytes.NewReader(files[0]), int64(len(files[0]))) if err != nil { return nil, err } // create virtual fs fs := memfs.Create() tmp, err := fs.OpenFile("/tmp.wav", os.O_RDWR|os.O_CREATE, 0777) n, err := tmp.Write(files[0]) // hack to expand the capacity, needs for memfs if err != nil { return nil, err } if n != len(files[0]) { return nil, errors.New("writing failure") } if err != nil { return nil, err } defer tmp.Close() file := r.GetFile() w, err := file.NewWriter(tmp) if err != nil { return nil, err } writer, _, err := w.GetDumbWriter() if err != nil { return nil, err } // copy first file firstReader, err := r.GetDumbReader() if err != nil { return nil, err } io.Copy(writer, firstReader) // only first file, for debugging // for _, chunk := range files[1:] { // copy others chunks // } w.Close() tmp.Seek(0, os.SEEK_SET) b, err := ioutil.ReadAll(tmp) return b, err }
But the headers of files are different. What I am doing wrong? Thanks.
Input file: - https://yadi.sk/d/PJE8hfxRrHnVB Output file: - https://yadi.sk/d/B8q1PBrTrHnVK
The text was updated successfully, but these errors were encountered:
Sorry.. I somehow didn't get an email notification for this issue.
I'll look into it and reply once I have an idea.
Sorry, something went wrong.
Sorry about this falling into oblivion.. Do you still need my insight here or did you solve it already?
Oh, I solved the problem via operating over mp3 files instead. No need more. Thank you.
No branches or pull requests
I do it in this way:
But the headers of files are different. What I am doing wrong? Thanks.
Input file: - https://yadi.sk/d/PJE8hfxRrHnVB
Output file: - https://yadi.sk/d/B8q1PBrTrHnVK
The text was updated successfully, but these errors were encountered: