Giter VIP home page Giter VIP logo

audio's Introduction

Jasny Audio

Process audio files using SoX

Waveform

With the Jasny\Audio\Waveform class you can create a waveform as PNG like:

waveform

$waveform = new Waveform($filename, $options);
$waveform->output();

Alternatively you can request a set of samples. This can be used to set draw a wavefrom in JavaScript (see waveform.js).

Options

option default unit description
width 1800 pixels Image width
height 280 pixels Image height
color 000000 hex or rgba Color of the graph
axis null hex or rgba Color of the x axis
level null The max amplitute (y axis)
offset null seconds Starting point. Negative counts from end
duration null seconds Duration of the track of chart

Track statistics

$track = new Track($filename);
$track->getStats();
{
    channels: "1",
    dc_offset: "0.000016",
    min_level: "-0.162134",
    max_level: "0.153157",
    pk_lev: "-15.80",
    rms_lev: "-33.56",
    rms_pk: "-24.31",
    rms_tr: "-55.44",
    crest_factor: "7.72",
    flat_factor: "0.00",
    pk_count: "2",
    bit_depth: "30/32",
    length: "1.935601",
    scale_max: "1.000000",
    window: "0.050",
    samples: "42680",
    scaled_by: "2147483647.0",
    maximum_amplitude: "0.153157",
    minimum_amplitude: "-0.162134",
    midline_amplitude: "-0.004489",
    mean_norm: "0.010709",
    mean_amplitude: "0.000016",
    rms_amplitude: "0.020990",
    maximum_delta: "0.115579",
    minimum_delta: "0.000000",
    mean_delta: "0.003656",
    rms_delta: "0.008325",
    rough_frequency: "1391",
    volume_adjustment: "6.168",
    sample_rate: "22050"
}

Convert track

Convert a track to a different format. Uses avconv (or ffmpeg).

$track = new Track("sometrack.wav");
$track->convert("sometrack.mp3");

Combine tracks

Combine two tracks. Uses sox --combine.

Available methods

  • concatenate
  • merge
  • mix
  • mix-power
  • multiply
  • sequence
$track = new Track($track1);
$track->combine($method, $track2, $outputFilename);

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.