Git Product home page Git Product logo

videodemo's Introduction

videodemo's People

Contributors

zzhengsr avatar

Stargazers

 avatar  avatar IceBreaker avatar  avatar wh avatar guoshaobao avatar  avatar havealex avatar  avatar  avatar Kimi avatar ghdevlei avatar maverick avatar Don Wong avatar 530 avatar Matrix avatar  avatar 小马哥nice avatar  avatar keven chen avatar  avatar  avatar  avatar Codesam avatar  avatar  avatar Jacob Kub avatar  avatar 卢泽平 avatar KongBaiGe avatar  avatar Linsea avatar 古格 avatar  avatar

Watchers

James Cloos avatar zhengshaorui avatar

videodemo's Issues

配置文件出的问题

安卓AnroidMainfest 配置文件下 application标签中少了一个android:requestLegacyExternalStorage="true"这个配置,导致录音文件无法创建报空指针

请教一下,为什么写两次head信息呢?

在AudioRecordActivity中,创建wav文件的时候为什么写两次head信息呢?感觉第一次不必要啊。

                byte[] headers = generateWavFileHeader(0, AUDIO_RATE, record.getChannelCount());
                //todo 疑问,这里写了一遍头信息
                wavFos.write(headers, 0, headers.length);

                //开始录制
                record.startRecording();
                byte[] buffer = new byte[minBufferSize];
                while (!isDone) {
                    //读取数据
                    int read = record.read(buffer, 0, buffer.length);
                    if (AudioRecord.ERROR_INVALID_OPERATION != read) {
                        //写 pcm 数据
                        fos.write(buffer, 0, read);
                        //写 wav 格式数据
                        wavFos.write(buffer, 0, read);
                    }

                }
                //录制结束
                record.stop();
                record.release();

                fos.flush();
                wavFos.flush();

                //修改头部的 pcm文件 大小
                wavRaf = new RandomAccessFile(wavFile, "rw");
                byte[] header = generateWavFileHeader(pcmFile.length(), AUDIO_RATE, record.getChannelCount());
                wavRaf.seek(0);
                //todo 疑问,这里不是写了两遍head信息吗?为啥呢
                wavRaf.write(header); 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.