Skip to content

Commit

Permalink
add changes for coveralls, set up changes for new gem version
Browse files Browse the repository at this point in the history
  • Loading branch information
domgetter committed Aug 13, 2014
1 parent 60a94fc commit 62571a6
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.gem
.rspec
.rspec
*.json
*.lock
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ source 'https://rubygems.org'
gemspec

gem 'rake'
gem 'pry'
gem 'pry'
gem 'coveralls', require: false
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
sound
=====
[![Gem Version](https://badge.fury.io/rb/sound.svg)](http://badge.fury.io/rb/sound)
[![Build Status](https://travis-ci.org/RSMP/sound.svg?branch=io)](https://travis-ci.org/RSMP/sound)
[![Coverage Status](https://coveralls.io/repos/RSMP/sound/badge.png)](https://coveralls.io/r/RSMP/sound)
[![Dependency Status](https://gemnasium.com/RSMP/sound.svg)](https://gemnasium.com/RSMP/sound)
[![Code Climate](https://codeclimate.com/github/RSMP/sound/badges/gpa.svg)](https://codeclimate.com/github/RSMP/sound)

**This Gem is still in alpha! Breaking and changes are expected everywhere!**

Cross Platform sound libraries for the Ruby developer

Expand All @@ -17,5 +23,19 @@ And then in irb or some script:

This will work on both windows and linux.

With some sensible defaults, the previous example can be written in one line:

Sound::Device.new {|d| d.write Sound::Data.new.sine_wave(440, 500, 1)}

More can be seen in examples/example.rb

The four main parts of this gem are Sound::Device, Sound::Format, Sound::Data,
and Sound::DeviceInterface. I haven't implented DeviceInterface quite yet, but
Sound::Win32 and Sound::ALSA are going to become it. That way more platforms
can be added easily. Obviously the only Data object that can be made is a sine
wave (albeit two different ways), but that will grow into more data types like
midi sequences and data pulled from audio files. As for Format, well that will
just be PCM or MIDI for now, but that may evolve too.

Come back for more features in the future including more data
types (loading from files, other wave types), and new formats (midi).
2 changes: 1 addition & 1 deletion examples/example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

Sound::Device.new {|d| d.play Sound::Data.new.sine_wave(440, 500, 1)}

# Let's play a little melody!
# Let's play a little melody! It starts to get out of sync about halfway through

threads = []

Expand Down
8 changes: 4 additions & 4 deletions sound.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Gem::Specification.new do |spec|

spec.name = 'sound'
spec.version = '0.0.6'
spec.date = '2014-08-10'
spec.version = '0.0.7'
spec.date = '2014-08-13'
spec.summary = 'cross-platform sound library wrapper'
spec.description = 'Allows for effiecent cross-platform sound libraries in pure Ruby by tapping into native libraries.'
spec.authors = ["Dominic Muller"]
Expand All @@ -15,8 +15,8 @@ Gem::Specification.new do |spec|
"lib/sound/data.rb",
"lib/sound/device.rb",
"lib/sound/format.rb",
"lib/sound/win32/sound.rb",
"lib/sound/linux/sound.rb"
"lib/sound/win32.rb",
"lib/sound/alsa.rb"
]
spec.add_runtime_dependency 'ffi'
spec.add_development_dependency 'rspec'
Expand Down
12 changes: 12 additions & 0 deletions spec/sound/data_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,16 @@

describe Sound::Data do

context "a new data object" do
let(:data) {Sound::Data.new}
it "has a format"
it "can have a sine wave written to it"
end
context "when a sine wave is generated" do
let(:data) {Sound::Data.new.generate_sine_wave(440, 500, 1)}
it "has a freq of 440"
it "has a duration of 500 milliseconds"
it "has a volume of 1 (full volume"
end

end
4 changes: 3 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
require 'sound'
require 'sound'
require 'coveralls'
Coveralls.wear!

0 comments on commit 62571a6

Please sign in to comment.