Giter VIP home page Giter VIP logo

Comments (4)

mackron avatar mackron commented on May 26, 2024 1

The issue here is the format. It needs to be IEEE instead of PCM for floating point.

from rfxgen.

raysan5 avatar raysan5 commented on May 26, 2024

@Antilurker77 I've been investigating this issue and it seems it fails in ExportWave() and only for float 32bit data. For 8/16bit it seems to work ok. The related code that exports that data is provided by drwav library:

        drwav wav = { 0 };
        drwav_data_format format = { 0 };
        format.container = drwav_container_riff;
        format.format = DR_WAVE_FORMAT_PCM;
        format.channels = wave.channels;
        format.sampleRate = wave.sampleRate;
        format.bitsPerSample = wave.sampleSize;

        void *fileData = NULL;
        size_t fileDataSize = 0;
        success = drwav_init_memory_write(&wav, &fileData, &fileDataSize, &format, NULL);
        if (success) success = (int)drwav_write_pcm_frames(&wav, wave.frameCount, wave.data);
        drwav_result result = drwav_uninit(&wav);

        if (result == DRWAV_SUCCESS) success = SaveFileData(fileName, (unsigned char *)fileData, (unsigned int)fileDataSize);

        drwav_free(fileData, NULL);

Maybe @mackron could know if there is any issue with the export? I'm attaching a zip with the sound.rfx to regenerate the sound with rFXGen and also the sound exported as 8bit, 16bit and 32bit wav files: sound.zip.

EDIT: Tested against dr_wav v0.13.4 - 2021-12-08

from rfxgen.

raysan5 avatar raysan5 commented on May 26, 2024

@mackron Wow! Superfast answer! Thank you very much! :D

from rfxgen.

raysan5 avatar raysan5 commented on May 26, 2024

Reviewed in raylib commit raysan5/raylib@58f2bf4

from rfxgen.

Related Issues (20)

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.