<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>イテルの一日一問 &#187; mp3</title>
	<atom:link href="http://oneday.ter.jp/tag/mp3/feed" rel="self" type="application/rss+xml" />
	<link>http://oneday.ter.jp</link>
	<description>一日にひとつは何かを考える。</description>
	<lastBuildDate>Mon, 31 Jan 2011 09:23:33 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://oneday.ter.jp/tag/mp3/feed" />
		<item>
		<title>as3でイコライザ再び</title>
		<link>http://oneday.ter.jp/actionscript3/226.html</link>
		<comments>http://oneday.ter.jp/actionscript3/226.html#comments</comments>
		<pubDate>Sun, 28 Jun 2009 14:06:24 +0000</pubDate>
		<dc:creator>イテル</dc:creator>
				<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[イコライザ]]></category>
		<category><![CDATA[音楽]]></category>

		<guid isPermaLink="false">http://oneday.ter.jp/?p=226</guid>
		<description><![CDATA[またも、イコライザが気になりクリクリ調査。 52secNoteさんのサイトを発見。 さっそく試してみることにした。 で、できたのがこれ。 If you can see this, then you might need  [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-thumbnail wp-image-244" title="090630-2" src="http://oneday.ter.jp/wp-content/uploads/2009/06/090630-21-700x200.jpg" alt="090630-2" width="700" height="200" /></p>
<p>またも、イコライザが気になりクリクリ調査。</p>
<p><a href="http://52sec.org/wordpress/?p=101" target="_blank">52secNote</a>さんのサイトを発見。</p>
<p>さっそく試してみることにした。</p>
<pre class="brush: as3; title: ; notranslate">
var myVolume:int = 0;

var bgm:Sound = new Sound();
bgm.addEventListener(Event.COMPLETE, onSoundLoaded);
var req:URLRequest = new URLRequest(&amp;quot;http://domain.domain/path.mp3&amp;quot;);
var trans:SoundTransform = new SoundTransform(1, 0);
var channel:SoundChannel;
var soundBox01:SoundBox = new SoundBox(5, 5, 2, 2, 1, 1, 0xFFFFFF);
ico_mc.ico_in_mc.addChild(soundBox01);

function onSoundLoaded(event:Event):void{
channel = bgm.play(0, 500);//500はリピート回数
soundBox01.start();
}
bgm.load(req);

//クリックしたとき音楽を停止or再生
ico_mc.buttonMode=true;
ico_mc.addEventListener(MouseEvent.CLICK,click);
function click(e:Event):void{
// 再生チャネルは初期化されている？
if(channel) {
myVolume = ++myVolume % 2;
switch(myVolume) {
case 0:
trans.volume = 0;
break;
case 1:
trans.volume = 1;
break;
}
channel.soundTransform = trans;
}
}
//※再生ボタンなど余計なところは消去してます。
</pre>
<p>で、できたのがこれ。</p>
<p><object type="application/x-shockwave-flash" style="width:125px;height:90px" data="http://oneday.ter.jp/swf_data/0906/090628/ico090628.swf"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="quality" value="best" /><param name="wmode" value="transparent" /><param name="movie" value="http://oneday.ter.jp/swf_data/0906/090628/ico090628.swf" /><param name="pluginspage" value="http://www.macromedia.com/go/getflashplayer" />If you can see this, then you might need a Flash Player upgrade or you need to install Flash Player if it's missing. Get <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash Player</a> from Adobe.</object><br/>
		<!-- Valid XHTML flash object delivered by XHTML Video Embed. Get it at: http://saltwaterc.net/xhtml-video-embed -->
		</p>
<p>実はよく理解せぬまま、ためさせてもらった（笑</p>
<p>でもステキだ～。</p>
<p>もっと小さくしたときでもわかりやすいともっとステキ・・・と言ってみるテスト。</p>
<p>また、イコライザをクリックしたときにミュートされるようにしてみたけど、</p>
<p>なんか一回目のクリックのときは無視されるみたい。。。</p>
<p>あとできちんと調べよ。</p>
]]></content:encoded>
			<wfw:commentRss>http://oneday.ter.jp/actionscript3/226.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://oneday.ter.jp/actionscript3/226.html" />
	</item>
		<item>
		<title>ちょっとしたイコライザ</title>
		<link>http://oneday.ter.jp/actionscript3/167.html</link>
		<comments>http://oneday.ter.jp/actionscript3/167.html#comments</comments>
		<pubDate>Sat, 20 Jun 2009 11:38:45 +0000</pubDate>
		<dc:creator>イテル</dc:creator>
				<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[イコライザ的な]]></category>
		<category><![CDATA[音楽と同期]]></category>

		<guid isPermaLink="false">http://oneday.ter.jp/?p=167</guid>
		<description><![CDATA[先日の音楽とswfを同期させる処理を調べていたら、「TheFlashBlog」さんを見つけた。 音楽に合わせて円を描くちょっとしたイコライザ的なもの（参照）。 とりあえず、わけのわからぬままコピペしてちょいと修正してみた [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-thumbnail wp-image-169" title="090620_one" src="http://oneday.ter.jp/wp-content/uploads/2009/06/090620_one-700x200.jpg" alt="090620_one" width="700" height="200" /></p>
<p>先日の音楽とswfを同期させる処理を調べていたら、「<a href="http://theflashblog.com/" target="_blank">TheFlashBlog</a>」さんを見つけた。</p>
<p>音楽に合わせて円を描くちょっとしたイコライザ的なもの（<a href="http://theflashblog.com/?p=181#" target="_blank">参照</a>）。</p>
<p>とりあえず、わけのわからぬままコピペしてちょいと修正してみた。</p>
<pre class="brush: as3; title: ; notranslate">
//変数類の宣言
var s:Sound = new Sound();
var sc:SoundChannel;
var ba:ByteArray = new ByteArray();
var array:Array;
//URLをセット
s.load(new URLRequest(&amp;quot;http://domain.domain/path.mp3&amp;quot;));

//読み込み時のイベント登録
this.addEventListener(Event.ENTER_FRAME, spectrum);
var a:Number = 0;

//波形を表示する
function spectrum(event:Event){
a = 0;
graphics.clear();
SoundMixer.computeSpectrum(ba,true,0);
for(var i=0; i &lt; 256; i=i+8){
a = ba.readFloat();
var num:Number = a*360;
graphics.lineStyle( num/15 , 0x0066FF | (num&lt;&lt; 8));
graphics.drawCircle(stage.stageWidth/2,stage.stageHeight/2,i);
}
}

// 再生ボタンを押したとき
play_b.buttonMode=true;
play_b.addEventListener(MouseEvent.CLICK,function(event){
//現在再生中の音楽を停止
if(sc){
sc.stop();
}
if(s){
//9999回リピートさせ再生
sc = s.play(0, 99999);
}
});
// 停止ボタン
stop_b.buttonMode=true;
stop_b.addEventListener(MouseEvent.CLICK,function(event){
//再生停止
if(sc){
sc.stop();
}
});
</pre>
<p>で、出来上がったのがこれ↓。</p>
<p><object type="application/x-shockwave-flash" style="width:400px;height:400px" data="http://oneday.ter.jp/swf_data/090620/test.swf"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="quality" value="best" /><param name="wmode" value="transparent" /><param name="movie" value="http://oneday.ter.jp/swf_data/090620/test.swf" /><param name="pluginspage" value="http://www.macromedia.com/go/getflashplayer" />If you can see this, then you might need a Flash Player upgrade or you need to install Flash Player if it's missing. Get <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash Player</a> from Adobe.</object><br/>
		<!-- Valid XHTML flash object delivered by XHTML Video Embed. Get it at: http://saltwaterc.net/xhtml-video-embed -->
		</p>
<p>こんなに簡単にできるんだ。</p>
<p>やっぱas3はおもろいなぁ。</p>
]]></content:encoded>
			<wfw:commentRss>http://oneday.ter.jp/actionscript3/167.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://oneday.ter.jp/actionscript3/167.html" />
	</item>
		<item>
		<title>Flash（as3）で音楽を再生する｜ロールオーバー</title>
		<link>http://oneday.ter.jp/actionscript3/139.html</link>
		<comments>http://oneday.ter.jp/actionscript3/139.html#comments</comments>
		<pubDate>Thu, 18 Jun 2009 05:15:55 +0000</pubDate>
		<dc:creator>イテル</dc:creator>
				<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[音楽再生]]></category>

		<guid isPermaLink="false">http://oneday.ter.jp/?p=139</guid>
		<description><![CDATA[昨日に引き続き、as3でmp3を再生する方法。 「ボタンのロールオーバー時に再生」のやつ。 っていうか簡単だった。 普通にロールオーバー時に再生してロールアウトに再生をやめればいいだけ。 If you can see t [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-thumbnail wp-image-148" title="090617" src="http://oneday.ter.jp/wp-content/uploads/2009/06/090617-700x200.jpg" alt="090617" width="700" height="200" /></p>
<p>昨日に引き続き、as3でmp3を再生する方法。</p>
<p>「ボタンのロールオーバー時に再生」のやつ。</p>
<p>っていうか簡単だった。</p>
<p>普通にロールオーバー時に再生してロールアウトに再生をやめればいいだけ。</p>
<pre class="brush: as3; title: ; notranslate">
import caurina.transitions.Tweener;

var sound_obj;    // サウンドオブジェクト
var channel;    // サウンドチャンネル
var url;

//サウンドファイルを選択
url = new URLRequest(&quot;http://domain.domain/path.mp3&quot;);
sound_obj = new Sound(url);
channel = null;

//ボタンとイベントを関連付ける
button1.addEventListener(MouseEvent.ROLL_OVER,playSound)
button1.addEventListener(MouseEvent.ROLL_OUT,stopSound)

function playSound(event:MouseEvent){
Tweener.addTween(button1,{ alpha:0.5 });
if(channel){
channel.stop();
}
if(sound_obj){
//9999回リピートさせ再生
channel = sound_obj.play(0, 99999);
}
}

function stopSound(event:MouseEvent){
Tweener.addTween(button1,{ alpha:1 });
//再生停止
if(channel){
channel.stop();
}
}
</pre>
<p><object type="application/x-shockwave-flash" style="width:300px;height:200px" data="http://oneday.ter.jp/swf_data/090618/test02.swf"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="quality" value="best" /><param name="wmode" value="transparent" /><param name="movie" value="http://oneday.ter.jp/swf_data/090618/test02.swf" /><param name="pluginspage" value="http://www.macromedia.com/go/getflashplayer" />If you can see this, then you might need a Flash Player upgrade or you need to install Flash Player if it's missing. Get <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash Player</a> from Adobe.</object><br/>
		<!-- Valid XHTML flash object delivered by XHTML Video Embed. Get it at: http://saltwaterc.net/xhtml-video-embed -->
		</p>
<p>今回もiLifeで作成した音源ｗ</p>
<p>通常のボタン効果音であれば、埋め込みの方がいいかも知れませんね・・・。</p>
<p>それは後日。</p>
]]></content:encoded>
			<wfw:commentRss>http://oneday.ter.jp/actionscript3/139.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://oneday.ter.jp/actionscript3/139.html" />
	</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.462 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-06 07:43:31 -->

