Code Monkey home page Code Monkey logo

audiotoimage's Introduction

AudioToImage

This program will create image of audio file.

This program can only run under the Linux operating system. This program has been tested in Centos 7 Minimal.

Before using this program, you must first install "Lame" and "Sox". Lame is needed to convert the file from MP3 format to WAV format because SoX does not support MP3 format.

How To Install

To install Lame, download RPM from the repository then install it on your server.

cd /var/development
mkdir /var/development/sox
cd /var/development/lame
curl --location http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz > lame-3.99.5.tar.gz
tar zxvf lame-3.99.5.tar.gz 
cd lame-3.99.5
./configure 
make 
make install
cd /var/development/lame
rm -rf lame-3.99.5.tar.gz 
rm -rf lame-3.99.5

To install SoX, download RPM from the repository then install it on your server.

cd /var/development
mkdir /var/development/sox
cd /var/development/sox
curl --location http://vault.centos.org/7.3.1611/os/Source/SPackages/sox-14.4.1-6.el7.src.rpm > sox.rpm
rpm -Uvh sox.rpm
yum install -y sox
rm -rf sox.rpm

Using PHP

<?php
include "AudioToImage.php";

// convert mp3 to wav
shell_exec("lame --decode suara.mp3");

$wave2png = new AudioToImage("suara.wav");
$image = $wave2png->generate_png();
header("Content-Type: image/png");
imagepng($image);
// You can also save image to a file
// i.e.
// imagepng($image, "suara.png");
?>

audiotoimage's People

Contributors

kamshory avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.