Skip to content

Berry-libsox is a Berry binding library for the Swiss Army knife of sound processing programs (SoX). (mirror from gitlab)

License

Notifications You must be signed in to change notification settings

MasterVitronic/berry-libsox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

berry-libsox: Berry bindings for libSoX

berry-libsox is a Berry binding library for the Swiss Army knife of sound processing programs (SoX).

It runs on GNU/Linux and requires Berry (>=0.1.10) and SoX (>=14.4.2).

Authored by: Díaz Devera Víctor Diex Gamar (Máster Vitronic)

Berry logo

License

MIT license . See LICENSE.

Documentation

See the Reference Manual.

Motivation:

This is a port of lua-libsox to test the capabilities of berry as a general purpose programming language.

Getting and installing

$ git clone https://gitlab.com/vitronic/berry-libsox.git
$ cd berry-libsox
berry-libsox$ make
berry-libsox$ make install # or 'sudo make install' (Ubuntu)

Example

#- Script: player.be

import libsox as sox

assert(sox.init())

input  = sox.open_read(_argv[1])
output = sox.open_write('default',input, 'alsa')

buf_sz = 8192*2
buffer = sox.buffer(buf_sz)
while true
	var sz = sox.read(input,buffer,buf_sz)
	if sz == 0 break end
	sox.write(output, buffer, sz)
end


sox.free_buffer(buffer)
sox.close(input)
sox.close(output)
sox.quit()

The script can be executed at the shell prompt with the standard Lua interpreter:

$ berry player.be sound.ogg

Other examples can be found in the examples/ directory contained in the release package

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

About

Berry-libsox is a Berry binding library for the Swiss Army knife of sound processing programs (SoX). (mirror from gitlab)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published