Showing posts with label Audio. Show all posts
Showing posts with label Audio. Show all posts

Wednesday, December 1, 2021

Cheapest, simplest method to record Binaural sounds using 2 recorders, phones etc.

 


Binaural sounds are almost like what we hear with natural source. If someone says hi behind us and we record audio in mono, stereo and binaural the best output with realism is recorded in binaural. This article makes a basic quality binaural recorder. The quality is not great because of limitations and manual steps required causing further inaccuracies. You can check the sample quality at end of article to check what it feels like.


As picture above shows we need 2 audio recorders. I used 2 Samsung devices with same official recorder app. Phone acts as left ear and tab acts as right ear. MIC are at top of the devices and therefore top is kept at middle of a box. Box acts are head reducing audio from both sides. Recording on both devices should begin at the same time!. If recording time is not same on both we have to shift the playback timing of one track to match both tracks.


IMPORTANT:

2 recorders must be of same hardware/model, same software and same settings to get same audio data. Different devices can work but many times volume levels & dominating frequency can differ e.g. high frequency/volume on left, lower on right etc.


When recording is done below steps are to be done to create final sound.

- Start Audacity app.

- Import Left audio recording from whatever device acted as left. If imported file is stereo it has to be converted into mono. Audacity can do that easily. Now this mono track should be set to Left Only track. There is a slider to set panning between Left and Right. Slide it to leftmost.

- Same as above right track is imported. Slider is shifted rightmost.

- Now Check the waveforms and using this the shifting of track can be done to match the timing issues happened during starting of recorders. Suppose started recording with a clap. Using the clap as reference we can do shifting of Left or right track until the timing error caused during recording is diminished.

- NOTE: Lets assume both track have been set to perfect time match i.e. a sound is heard at both ears at same time. This is actual wrong setup for binaural!. When sound comes from right it reaches right ear first and then left. The time travelled between right left ear MUST EXIST between the tracks. This is important for accuracy of audio source positions. Below is technical information and can be avoided if you cannot understand the topic but it tells the importance of time difference between Left and Right.

https://en.wikipedia.org/wiki/Interaural_time_difference

https://en.wikipedia.org/wiki/Sound_localization


After shifting of tracks sound can be tested and it will surely sound like binaural. The above method is very cheap and prone to lots of errors. This article is for giving understanding of binaural and some experimentations for advance work. Below is the recording I created.


Sample recording file:


https://drive.google.com/file/d/140yaOUVX4ptCyBduURUFXzGjx3Nrwl7o/view?usp=sharing


I hope this article has helped you in binaural recording. I also made an Android app in 2016 with automated process and create binaural recording easily. However I could not keep developing the app. Below are some links to the app -


https://forum.xda-developers.com/t/binaural-3d-sound-recorder-app-using-2-devices-as-mic.3361953/


backup apks for old android devices only. -


https://drive.google.com/file/d/1PP1N1HsOfLVqaMEMj77g0giLON9ecNuV/view?usp=sharing

Sample i recorded using my android app

https://drive.google.com/file/d/1PftsM9XHOUJB8vzL4cB4vUV5mGZ-28v3/view?usp=sharing




Thursday, July 29, 2021

Enhanced version of BeepFX 1.12 with export WAV and raw formats.

 The original version BeepFX 1.11 which is

"Beeper sound effects cross editor for ZX Spectrum 48K. Generates sound effects using small set of parameters, also has sample support. Source code included."

available at http://shiru.untergrund.net/software.shtml.

 

Original version is limited to ZX Spectrum users only however audio effects produced using just 1bit sound can be used in modern games also. The problem is it doesn't saves audio in wav etc format. For the same i edited the source and added Export RAW & WAV formats in batch. Editing source was not easy because i couldn't install Borland Studio 2006 on both Windows and Linux. So had to install VirtualBox with windowsXP and worked inside it. The source along with the BeepFX 1.12 binary is available below link -

https://drive.google.com/file/d/1b4A5NSbx5Nye2BuPHsM_lCIxEKkgbc7K/view?usp=sharing

 

There is also online version of similar software capable of producing nice audio effects.

Link - https://zx.remysharp.com/audio

 

Monday, July 22, 2019

Best Android Audio Player for chiptune, old console musics and 100s of formats!

Some years ago Android had lots of chiptune players but after Android 5 many disappeared. My favorite was DroidSound. It also disappeared from PlayStore. I am a developer and myself had created SoundFont midi player and was willing to revive DroidSound player and publish on PlayStore. However there are so many plugins and licenses that it will take lots of time managing them. But there is great news! DroidSound player it still getting updated to work on latest Android devices. Below are more information and links -

Update:
DroidSound is available here https://droidsounde.herokuapp.com/
And here https://droidsounde.herokuapp.com/

Below version are old but i recommend them as they don't ask for record audio permission forcefully.


Download DroidSound APK from here are enjoy Chiptune :).

NOTE: PlayStore apk is outdated 2015 version. Its here:
https://play.google.com/store/apps/details?id=com.droidmjt.droidsounde



Current version:
https://www.dropbox.com/s/71xq7cvinon919r/droidsounde167_177.apk?dl=1


Latest version: (look at bottom of page for link)
https://github.com/droidmjt/Droidsound



Website:
https://droidmjt.github.io/Droidsound/



DroidSound player is good for console musics and chiptunes. It can also play ogg, mp3 etc but for that its not much useful like other player. It also lacks seeking for many formats. It can also export chiptune to ringtones or stream formats. Below are plugins and supported formats. Refer to individual plugins from exhaustive list of formats supported.



OpenMPT plugin can play tracker files. Excerpt from OpenMPT page: https://wiki.openmpt.org/Manual:_Module_formats


The following formats can be imported into OpenMPT. Internally, they are converted to one of the file formats described above. Depending on the source format, conversion might not always be accurate.
  • Composer 669 / UNIS 669 (.669)
  • ASYLUM Music Format / Advanced Music Format (.amf)
  • Extreme’s Tracker / Velvet Studio (.ams)
  • Composer 670 / CDFM (.c67)
  • Digi Booster Pro (.dbm)
  • Digi Booster (.digi)
  • X-Tracker (.dmf)
  • DSIK (.dsm)
  • Digital Tracker / Digital Home Studio (.dtm)
  • Farandole Composer (.far)
  • General Digital Music (.gdm)
  • Ice Tracker / SoundTracker 2.6 (.ice / .st26)
  • Imago Orpheus (.imf)
  • Impulse Tracker Project (.itp) – legacy OpenMPT format with instruments stored in external files rather than directly in the module
  • Jazz Jackrabbit 2 Music (.j2b)
  • SoundTracker and compatible (.m15 / .stk)
  • DigiTrakker (.mdl)
  • OctaMED (.med)
  • MadTracker 2 (.mt2)
  • MultiTracker (.mtm)
  • Oktalyzer (.okt)
  • Epic Megagames MASI (.psm)
  • Disorder Tracker 2 (.plm)
  • ProTracker 3.6 IFF (.pt36)
  • PolyTracker (.ptm)
  • SoundFX / MultiMedia Sound (.sfx / .sfx2 / .mms)
  • Scream Tracker 2 (.stm)
  • Soundtracker Pro II (.stp)
  • UltraTracker (.ult)
  • Unreal Music (.umx) only from Unreal (Tournament 1), Deus Ex and Jazz Jackrabbit 3D
  • Grave Composer (.wow)


Stream formats like ogg, mp3, m4a etc are supported.



GME plugin can play below files. Table taken from -
http://www.slack.net/~ant/libs/audio.html

FormatSystem
AYZX Spectrum, Amstrad CPC
GBSNintendo Game Boy
GYMSega Genesis, Mega Drive
HESNEC TurboGrafx-16, PC Engine
KSSMSX Home Computer, other Z80 systems (doesn't support FM sound)
NSF, NSFENintendo NES, Famicom (with VRC 6, Namco 106, and FME-7 sound)
SAPAtari systems using POKEY sound chip
SPCSuper Nintendo, Super Famicom
VGM, VGZSega Master System, Mark III, Sega Genesis, Mega Drive, BBC Micro




GSF plugin can play GSF Gameboy Advance audio files.



HE i.e Highly Experimental plugin can play PlayStation 1 PSF and PlayStation 2 PSF2 files.


Hively plugin can play hively tracker files AHX, HVL. http://www.hivelytracker.co.uk/about.php


HQ plugin can play some psf+psflib files. Kabuki encrypted.


HT plugin can do Saturn and Dreamcast sound emulation. psflib like format.


NDS plugin can play Nintendo DS music 2sf files.


SC68 plugin can play Atari & Amiga files. http://sc68.atari.org/


SID plugin can play SID C64 audio files.


UADE plugin for Amiga files.


LazyUSF plugin can play Nintendo 64 USF audio files.


VGM plugin can play VGM (Video Game Music) of Sega
Master System, Sega Game Gear and possibly other machines like Sega
Genesis. https://vgmrips.net/forum/viewtopic.php?t=112


VGMstream plugin can play console stream files like xa, strm files for Nintendo DS, PSX etc. https://github.com/losnoco/vgmstream.


Adlib plugin inside VGM plugin can play Adlib, OPL files. Below section taken from https://adplug.github.io/

AdPlug implements unique file replayers for each supported audio format in order to achieve the best possible replay quality. Players marked as "preliminary" aren't considered final by the author and may contain many replay issues, but are included for testing purposes anyway. As of now, the following formats are supported:
  • A2M: AdLib Tracker 2 by subz3ro
  • ADL: Westwood ADL File Format
  • AGD: Herbulot AdLib Gold System (HERAD) by Remi Herbulot (preliminary)
  • AMD: AMUSIC Adlib Tracker by Elyssis
  • BAM: Bob's Adlib Music Format
  • BMF: Easy AdLib 1.0 by The Brain
  • CFF: BoomTracker 4.0 by CUD
  • CMF: Creative Music File Format by Creative Technology
  • CMF: SoundFX Macs Opera tracker by Linel
  • D00: EdLib by Vibrants
  • DFM: Digital-FM by R.Verhaag
  • DMO: Twin TrackPlayer by TwinTeam
  • DRO: DOSBox Raw OPL Format
  • DTM: DeFy Adlib Tracker by DeFy
  • GOT: God Of Thunder Music by Roy Davis of Adept Software
  • HA2: Herbulot AdLib System v2 (HERAD) by Remi Herbulot (preliminary)
  • HSC: HSC Adlib Composer by Hannes Seifert, HSC-Tracker by Electronic Rats
  • HSP: HSC Packed by Number Six / Aegis Corp.
  • HSQ: Herbulot AdLib System (HERAD) by Remi Herbulot (preliminary)
  • IMF: Apogee IMF File Format
  • IMS: IMPlay Song Format
  • JBM: JBM Adlib Music Format
  • KSM: Ken Silverman's Music Format
  • LAA: LucasArts AdLib Audio File Format by LucasArts
  • LDS: LOUDNESS Sound System
  • M: Origin AdLib Music Format
  • MAD: Mlat Adlib Tracker
  • MDI: AdLib MIDIPlay File Format by Ad Lib Inc.
  • MID: MIDI Audio File Format
  • MKJ: MKJamz by M \ K Productions (preliminary)
  • MSC: AdLib MSCplay
  • MTK: MPU-401 Trakker by SuBZeR0
  • MUS: AdLib MIDI Music Format by Ad Lib Inc.
  • RAD: Reality ADlib Tracker by Reality
  • RAW: RdosPlay RAW file format by RDOS
  • RIX: Softstar RIX OPL Music Format
  • ROL: AdLib Visual Composer by AdLib Inc.
  • S3M: Screamtracker 3 by Future Crew
  • SA2: Surprise! Adlib Tracker 2 by Surprise! Productions
  • SAT: Surprise! Adlib Tracker by Surprise! Productions
  • SCI: Sierra's AdLib Audio File Format
  • SDB: Herbulot AdLib System (HERAD) by Remi Herbulot (preliminary)
  • SNG: SNGPlay by BUGSY of OBSESSION
  • SNG: Faust Music Creator by FAUST
  • SNG: Adlib Tracker 1.0 by TJ
  • SOP: Note Sequencer by Lee Ho Bum (sopepos)
  • SQX: Herbulot AdLib System (HERAD) by Remi Herbulot (preliminary)
  • VGM: Video Game Music 1.51 by Valley Bell (preliminary)
  • XAD: eXotic ADlib Format by Riven the Mage
  • XMS: XMS-Tracker by MaDoKaN/E.S.G
  • XSM: eXtra Simple Music by Davey W Taylor


Tuesday, February 28, 2017

WildMidi for Android: Compiling WildMidi using Android NDK rev 13

Android had no standard midi protocol before Marshmallow. Even after a standard MIDI event API for a developer to build android app which does midi synthesis by itself is a great feature!. In 2016 i compiled FluidSynth 1.6 for Android and created a SoundFont Midi Player with USB keyboard support. This app can play midi, rmi files and can send midi events via USB MIDI Keyboard, Normal USB keyboard to fluidsynth to synthesize sound. Due to latency and high CPU consumption issues i decided to look at other options. One good option was WildMidi.


WildMidi - https://www.mindwerks.net/projects/wildmidi/


It says -

"The WildMIDI library uses Gravis Ultrasound patch files to convert MIDI files into audio which is then passed back to the calling application for further processing or output

Library Features

  • RIFF MIDI file support
  • MIDI format 0, 1 and 2 support
  • MIDI-like formats: KAR, HMI, HMP, MUS and XMI
  • Cross Platform: Linux, Windows, OSX, FreeBSD and etc.
  • Thread safe
  • host-Endian native streaming
  • WAV file output
  • Linear and gauss re-sampling
  • Final output reverb engine
  • Timidity.cfg compatibility
Player Features

  • OSS and Alsa Output (Linux/FreeBSD)
  • Windows Sound System support (Windows)
  • OpenAL (OSX/Others)
  • SoundBlaster 16 (DOS)"


In Player features Android sound system is not mentioned and that doesn't mean it cannot be used in Android. I compiled WildMidi for Android and the link to download the binary package is mentioned later in this page. I tested WildMidi on Ubuntu-Studio which had inbuilt "FreePats". The Gravis Ultrasound Patch files are used by WildMidi to synthesize sound. We can use WildMidi player to play midi files on Android by modifying its player code by sending PCM buffer to Android OpenSLES or AudioTrack.

Can wildmidi be used for sending MIDI events to build piano like app with fast response? Currently NO as per wildmidi source!


Looking at source code of wildmidi inside wildmidi_lib.h. It says "Not Yet Implemented". That "latency" thing! everywhere.

Preview:
/* NOTE: Not Yet Implemented Or Tested Properly */
/* Due to delay in audio output in the player, this is not being developed
   futher at the moment. Further Development will occur when output latency
   has been reduced enough to "appear" instant.
WM_SYMBOL int WildMidi_Live (midi * handle, uint32_t midi_event);
 */

/* reserved for future coding
 * need to change these to use a time for cmd_pos and new_cmd_pos

WM_SYMBOL int WildMidi_InsertMidiEvent (midi * handle, uint8_t char midi_cmd, *char midi_cmd_data, unsigned long int midi_cmd_data_size, unsigned long int *cmd_pos);
WM_SYMBOL int WildMidi_DeleteMidiEvent (midi * handle, uint8_t char midi_cmd, unsigned long int *cmd_pos);
WM_SYMBOL int WildMidi_MoveMidiEvent (midi * handle, , uint8_t char midi_cmd, unsigned long int *cmd_pos, unsigned long int *new_cmd_pos);
 */



This can be used to build a midi player for android using wildmidi synthesizer. The build script is same as libpng build script mentioned on my other article.



Download wildmidi arm binary from here:
https://github.com/bindeshkumarsingh/android-native-libs




Tuesday, February 7, 2017

Useful Collection of Public Domain, Creative Commons, Free sounds and graphics for commercial use

As an Indie developer i required lot of free sound, music and game art for commercial use. Internet is huge but it still lacks resources with permissible license. Looking for free stuff is not bad but also not great because every work has value and in real life there is no free meal. There are very helping people who offer their work for free to ease development work of indie workers. Below are links to such useful assets.



opengameart.org

http://www.opengameart.org

A website with lots of free multimedia resources. Contains 2D, 3D, music, sound etc stuff with search and page wise browsing. It includes resources with multiple types of open licenses.



Kenney Vleugels website:

http://kenney.nl/


"We've created over 35,000 images, audio files and 3D models for you to use in your projects. Thanks to our public domain license you're even allowed to use them in commercial projects!"

220+MB of arts and sounds.




Glitch Game Art

https://www.glitchthegame.com/public-domain-game-art/

"The collaborative, web-based, massively multiplayer game Glitch began its initial private testing in 2009, opened to the public in 2010, and was shut down in 2012. It was played by more than 150,000 people and was widely hailed for its original and highly creative visual style.

The entire library of art assets from the game, has been made freely available, dedicated to the public domain. Code from the game client is included to help developers work with the assets. All of it can be downloaded and used by anyone, for any purpose. (But: use it for good.)"


Huge collection of arts. Don't miss it!



The Last Door Game Assets

http://thelastdoor.com
http://opengameart.org/content/the-last-door-season-one-complete-assets-pack

"Hey pals! We have a special gift for you! Today, in commemoration of Alan Turing, father of modern computing, all of Season One's assets will become open source! Also, we want to commemorate you, as the great community we proudly have. Thank you so much! Now you can create your own 'The Last Door' content by using the original graphics and sounds! Create videos, animate gifs or develop your won 'The Last Door' game! The assets are under Creative Commons Attribution 4.0 license, so you can spread your passion in all formats and ways."



https://kronbits.itch.io/matriax-free-assets

"Hi! I'm Davit Masia, I create a lot of graphics for fun, mockups,etc... that usually ends lost on my folders. So i decided upload and share with everybody all that stuff so people can use in their projects. Assets are free but any donation will be welcomed and motivate me to add more and more"

Around 30MB of free arts.



https://github.com/sparklinlabs/superpowers-asset-packs

https://sparklinlabs.itch.io/superpowers

"The assets in this repository are created at Sparklin Labs by Pixel-boy.
They are released under the Creative Commons Zero (CC0) license.

You can use the assets found in this repository in your own games, even commercial ones. Attribution is not required but appreciated. Placing a link to http://superpowers-html5.com/ somewhere would be awesome :)"



http://www.gameart2d.com/

"GameArt2D.com is a place to buy royalty free 2D game art assets. It contains more than 50 items, from platformer & top down tileset, side scrolling & top down character spritesheet, game GUI, space shooter asset, and many more.

Who's the guy behind this site?
I'm Zuhria Alfitra a.k.a pzUH. A lone wolf indie-gamedev-wannabe from Yogyakarta, Indonesia."



http://www.wpclipart.com/downloads.html

Huge collection of cliparts, images of animals, plants, education, shapes etc. It can be very helpful to make a derivative art. Get a simple shape and enhance it to something more beautiful. ~1GB of images. Public Domain.



https://openclipart.org/

"Unlimited Commercial Use

We try to make it clear that you may use all clipart from Openclipart even for unlimited commercial use. ... We use the Creative Commons Zero 1.0 Public Domain License every time an artist uploads a piece of clipart to Openclipart to make it clear the artist is releasing the creative work for anyone to use for any reason, even commercially."




https://github.com/saniv/free-game-art

Very good collection of collections!. This is a MUST visit page. However the repository is big and sometimes you might want to download only few folders from github. For example we want to download a CC0 or non GPL licensed assets. If you know how to use command line then a single folder can be exported from github. GUI based software can also do that.

For example you want to download https://github.com/saniv/free-game-art-unsorted/tree/master/oblique/DCGames_stuff folder but there is no option on that page. Start command shell like bash on Linux or cmd.exe on Windows. Install SVN subversion software and run this command -


Firstly copy the link

https://github.com/saniv/free-game-art-unsorted/tree/master/oblique/DCGames_stuff

Then replace tree/master by trunk. It becomes like this -

https://github.com/saniv/free-game-art-unsorted/trunk/oblique/DCGames_stuff


Now run

svn export https://github.com/saniv/free-game-art-unsorted/trunk/oblique/DCGames_stuff

This will download only the DCGames_stuff folder. If you don't like command line then try a GUI software like TortoiseSVN and export the url above as example.




https://craftpix.net/freebies/


Freebies license:

"You are permitted to use the resources in any number of personal and commercial projects for yourself or a client.
You can modify the resources according to your requirements and include them into works such as websites, applications, printed materials and others."









Textures:



Blender Texture Disc

Public domain textures pack in a CD.


Sweet home 3D texture packs

https://sourceforge.net/projects/sweethome3d/files/SweetHome3D-textures/Textures-1.1/

Contains some useful texture packs.



http://unluckystudio.com/

Owned by Sujit Yadav. He has shared some useful vector arts.



NOTE:
To get more images and textures one can use public domain or CC0 like licensed photos or videos.





3D models:


http://telias.free.fr/

"Hi there. 'Free the models' is a site dedicated to provide free content for 3d applications and 3d/game engines. The license of the content is that what you download from here is one step away from public domain. So, everything you download from here is free for any use EXCEPT it cannot be included in another free web or cd collection and it cannot be sold separately. Otherwise you can use it in your commercial game, 3d application or render work. You don't have to provide credit but It would be nice if you do. Thank you. Elias Tsiantas /Herakleion/Greece."




https://sourceforge.net/projects/sweethome3d/files/SweetHome3D-models/3DModels-1.5.1/

Lots of 3D models in sh3f format. Its like zip file and can be extracted.






Free Sounds:



http://www.99sounds.org

A very useful and huge collection of high quality audios. Below are some sound files i downloaded from this website.

[99Sounds] 99 Drum Samples
[99Sounds] Atmospherik Mekanisms
[99Sounds] Cinematic Sound Effects
99Sounds Drones
[99Sounds] InterSpace
[99Sounds] Magnetic Fields
[99Sounds]_Massamolla
[99Sounds] Percussa Toolbox by Richard Gould
[99Sounds] Project Exodus
[99Sounds] Project Pegasus
[99Sounds] Punching Percussion
99Sounds Radiophonic Atmospheres by Red Sky Lullaby
[99Sounds] Rain And Thunder
[99Sounds] Sound Design Tools
[99Sounds] The Warehouse


The files are very big and i have compressed them to very low size still maintaining quality. Due to their license restriction i cannot share those compressed ogg files. Please visit their site and download them all. Many of these audio have 96KHz sample rate. Do read the download resume technique at end of this article to download from this site because the big files many times stop resuming.



https://www.freesound.org/

Various licenses and huge collection of user submitted sounds.


www.pacdv.com/sounds/

Another good site i used.
Search "free sounds" on Google. There are many sites like this.





Get sound samples from sound pack formats

One best way to get sounds is packed, synth sound formats. Sound formats like SoundFont SF2, Downloadable Sound DLS, Patch (pat files). There are many sites which offer these files. Below are some valuable sound collections or packs.


cybernetik_mayhem_samplepack_-_by_cybernetika

Big collection of sound sample. Uncompressed size 844 MB



DrumKits from Hydrogen DrumMachine app

The drumkit files are zip files with sample configuration. Extract audio files from them and use in any DAW. Drumkits names:

3355606kit, ColomboAcousticDrumkit, HardElectro1, Synthie-1, BJA_Pacific, DeathMetal, HipHop-1, TD-7kit, Boss_DR-110, EasternHop-1, HipHop-2, Techno-1, circAfrique v4, ElectricEmpireKit, K-27_Trash_Kit, TR808909, Classic-626, ErnysPercussion, Millo-Drums_v.1, VariBreaks, Classic-808, ForzeeStereo, Millo_MultiLayered2, YamahaVintageKit




http://www.rhythm-lab.com

Many free sound samples.




Download some free Digital Audio making software and many of them offer free sound packs inside them. Linux Multimedia Studio is among them. Download tracker music software and their XI instruments which can be converted to wav or flac.






List of CC0 websites for images, wallpapers, photos

https://www.pexels.com/
https://freeimages.red/
https://stocksnap.io/
http://skitterphoto.com/
https://pixabay.com/



https://blog.wikimedia.org/2017/02/07/the-met-public-art-creative-commons/


"The Metropolitan Museum of Art makes 375,000 images of public domain art freely available under Creative Commons Zero"

As it says huge collection of museum art can be used for even commercial purpose. Deriving these arts to make new things can be very useful.




How to get more multimedia assets with lesser effort?


I spent lot time in learning programming, music, sound effects, digital arts and some more skills. Now i can make games alone. However i realized one must rather invest time in one skill they love most and Master that skill ( I love all but music is at top :) ). What about those technologies where skill is not enough to complete a work faster? There are many ways to do it. You can pay to a freelancer and get your work done. What if you don't have much money?. This is where free stuff comes to help. Some very useful links have been shared above. But now i will share techniques to get free stuff with little effort.

A video is a sequence of pictures. Therefore an open licensed movie is also bundle of same license image assets. With this idea i downloaded open source videos like BigBuckBunny. ElephantsDream, Sintel etc. There are lots of effects, textures, sounds etc in these videos. Extract data from these videos and use them wherever needed. But don't forget to follow the license honestly!.


Here are links of some public domain, Creative Commons videos:


Blender Movies:

https://www.blender.org/features/projects/


Other:

https://en.wikipedia.org/wiki/List_of_animated_films_in_the_public_domain_in_the_United_States

http://tvtropes.org/pmwiki/pmwiki.php/Main/PublicDomainAnimation

https://en.wikipedia.org/wiki/List_of_open-source_films


WARNING:


There are many resources which are public domain but can still cause copyright issues. For example old SuperMan cartoons are public domain but the SuperMan himself is not!. Please be careful for these type of things.






How to resume downloads which expires if stopped?

Many websites generate download links which expire after some time or fail if multiple connections are created. I use UGET on linux. Windows version of this software is also available. Simply add a URL and start downloading. When a new url is created go to properties of the download item and replace the old url by new url. Another way is to use KGET. Its also a Linux app. It can add mirror links. Add whenever a new link is created.


Download link:
http://ugetdm.com/ 




The links shared here can be very helpful to many indie and non-indie developers. Please submit links in comments i will add here.

Friday, October 14, 2016

Audio Visualizer using libGDX for multiple platforms

This article & project is about visualizing audio as waveforms on screen. Before starting let's understand few terms and minimum requirements related to the project. Most of details about app is inside the source code. This article is only about audio section.

Requirements:
  • A device supported by libGDX library. 
  • Device must support microphone. 



Sample Rate:
Total number of samples of audio to be captured per second. We will use standard 44100 samples per second i.e. 44.1KHz.


Audio Sample:
Size of 1 sample. 1 sample is signed 16 bits in size and therefore can represent total 65536 volume levels. Negative samples have value from -1 to -32768 and +ve samples have value from 0 to 32767. We will use Mono samples only. Please refer to Audio documentation on Wikipedia, website or a book for further information on samplerate etc.



Working:
This project uses libGDX audio recorder interface to capture audio from MIC. Code is extremely simple to understand and implement on multiple platforms. Functions to create & delete recorder.

public final void make_recorder() {
        if( m_rec == null ) {
            m_rec = Gdx.audio.newAudioRecorder(44100, true);
            m_samples = new short[ (int)(44100f / FPS)];            
        }
    }
    public void destroy_recorder() {
        if( m_rec != null ) {
            m_rec.dispose();
            m_rec = null;
        }
    }

Below code is used for capturing audio samples in a buffer for drawing purpose.

m_rec.read(m_samples, 0, m_samples.length);
// plot samples by moving from left middle of screen to right middle. Delta is how
// high the resolution of plotting is.
for( float i = 0; i <= 100f; i += delta ) {
       
}




m_sample is a short buffer of size 44100/FPS. This is because in this project we draw screen at 25FPS and every frame plots audio data. So we divide 1 second of audio into 25 parts and sync with screen. Total samples we need per frame is 44100/FPS.



Pseudo code of drawing audio data:
  • Capture 44100/FPS number of samples into SAMPLES buffer. 
  • Loop from left middle of screen i.e. x=0 to x=100% of screen width plotting audio sample related to the % value. Means x=0% means 0% position of sample in SAMPLES. x=35% = 35/100 x SAMPLES's SIZE. Formula: Audio Sample = PERCENT_POS/100 * SAMPLES's SIZE. 
  • Take amplitude of sample as per your choice and plot audio using pixel. Plot line between current and last sample. 


Visualizer snapshot:



Download link for java only source code of project.

MylibGDX-articles-14-Oct-2016.7z


With same logic i built my Sound Visualizer which renders beautiful design using voices. It can be called Rangoli Maker or simple Mandalas or Cymatics kind of plotter. Cymatics needs lots of calculation in 3D but this app is good for flower like designs.


Download link for Android app:
http://play.google.com/store/apps/details?id=org.greh.sacredsound