Git Product home page Git Product logo

easyflac's Introduction

easyFLAC

  • Wrapper library of libFLAC.
  • とりあえずWindows用のDLLとして作成

Feature

  • Decode FLAC file
  • Seek
  • Vorbis Comment acquisition
  • Support 8/16/24bit
  • openFile, getFileInfo, render, closeの4関数でデコード可能
  • stdcall Windows DLL

example

#include "easyFLAC.h"
#define TEST_SAMPLE_SIZE 40000

int main(int argc, char* argv[]) {
  printf("EASYFLAC_PROTOTYPE - PROGRAMMED BY RGBA_CRT rev2 2020.4.24\n");
  if (argc == 1)
    return 1;

  EASYFLAC_HANDLE handle;
  handle = FLAC_openFile((char*)argv[1]);
  if (handle == NULL)
    return 1;

  EASYFLAC_FILE_INFO info;
  FLAC_getFileInfo(handle, &info);

  uint8_t buffer[TEST_SAMPLE_SIZE * 6] = {0xFF};
  FILE* fout = fopen("out.rwav", "wb");
  if (!fout) 
    return -1;

  uint32_t decoded_samples;
  FLAC__StreamDecoderState render_ret;
  while (1) {
    render_ret = FLAC_render(handle, buffer, TEST_SAMPLE_SIZE, &decoded_samples);
    printf(".");
    fwrite(buffer, decoded_samples, handle->sampleSize, fout);
    if (render_ret == FLAC__STREAM_DECODER_END_OF_STREAM) break;
  }

  FLAC_close(handle);
  fclose(fout);
  printf("\ndone.");

  return 0;
}

Programmed by RGBA_CRT 2020
Project url: https://github.com/RGBA-CRT/easyFLAC/

easyflac's People

Contributors

rgba-crt avatar

Watchers

 avatar  avatar

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.