FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Yay! Sound works!

 
Post new topic   Reply to topic     Forum Index -> ArcLib
View previous topic :: View next topic  
Author Message
davidb



Joined: 03 Apr 2007
Posts: 15

PostPosted: Thu Apr 19, 2007 12:29 pm    Post subject: Yay! Sound works! Reply with quote

First of all: Thanks for your work!

I've been currently just playing a bit with
the svn repository and it's surely fun!
The code is really easily readable
and the ddoc commentation (where it exists)
is a great help.

But to cut a long post short:
<skip to end, only ranting here...>
I tried the sound support.
I uses the ddocs to produce valid (compiler-valid) code,
but when I ran it, it just produced a Stack Overflow.
I tried this and that, disabled command after command
until i found arc.sound.open() to be responsible.
So I checked the arc source, checked a tutorial on OpenAL,
everything, but it wouldn't work, until I found a solution (how could it work another way...):
A tutorial with a "OpenAL32.dll" with a size of 140kB
instead of 30kB (the one provided in arclib\download\dll).
Replaced the old, and suddenly I could play
wavs and oggs without any problem at all.
Then I tested the officially distributed one (openal.org, Win Installer)
which worked as well.
I removed the two files the installer had installed,
and tried again the 30kB File (provided in the svn),
but instead of an Stack Overflow I got the
Exception thrown by arc.sound.open().
Several tests later ... (*g*)
I conclude: All three versions work,
but the svn-version and the official win installer version
need the file "wrap_oal.dll" (provided with the win installer).
<end of story>

So I suggest, put "wrap_oal.dll" in the svn-repo.


david

ps: "to cut a long story short" - hey, I tried!
pps: see line 1!
ppps: tested on winxp
Back to top
View user's profile Send private message
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Thu Apr 19, 2007 1:14 pm    Post subject: Reply with quote

I'm using the 30KB OpenAL32.dll with Yage also. It's originally 84KB but I used UPX to make it smaller. I suppose Clay's using my same binary Smile.

Right click on the dll and go to properties. My version is:

6.14.0357.11
Standard OpenAL(TM) Implementation
Portions (C) Creative Labs Inc. and NVIDIA Corp.
Back to top
View user's profile Send private message
ChristianK



Joined: 26 Sep 2006
Posts: 159
Location: Berlin, Germany

PostPosted: Thu Apr 19, 2007 1:19 pm    Post subject: Reply with quote

That sounds like quite an odyssey, I'm glad you got it to work in the end and suppose Clay will look into it - he's usually doing windows compatibility.

Feel free to post things on this forum or mail me (kamm at get rid of this, incasoftware de) if you're stuck or need some help with a component. We're still working on Arc and adding more documentation is a large issue, so every question will give us a hint about where we have to improve.

Are you working on something in particular or just trying things out? Do you miss any features? Do you find something hard to use?
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Thu Apr 19, 2007 3:11 pm    Post subject: Reply with quote

Yes I am indeed using JoeCoder's dll's it looks like Smile You can thank JoeCoder for the sound and xml codes too.

david, do you want to test the wrap_oal.dll I just put in the dll/ folder? Don't have much time on my hands to test it /right/ away.
Back to top
View user's profile Send private message AIM Address
davidb



Joined: 03 Apr 2007
Posts: 15

PostPosted: Thu Apr 19, 2007 3:22 pm    Post subject: Reply with quote

@JoeCoder: Yes, same version.

@ChristianK: Took some time, yeah. I posted it for future generations ^_^
Currently, I'm just trying to get all the features working.

@clay: The dll in the svn is 2.0.0.0, the one i got from openal.org is 2.1.4.0,
but both work (just one testrun with a .ogg file, but that should be sufficient)

And I'm failing to understand widget.draw(),
although the picture won't show if
I omit it in the "main" loop (and just use it at the beginning).
All it should do is
assert(0)
and I just updated my repository, weird...
(Where did you hide the functionality,
come on, you can tell me Mr. Green )

about documentation: Perhaps a short d program
that compiles the current trunk to docs (with candydoc)
and creates an index.html would be helpful?
There is a documentation in arclib\web\arc\arc,
but it's outdated and the current script in arclib\web\arc
uses explicit paths (I changed mine, but for general usefulness).
And a file that just dumps the *.htm(l) directory entries
in an index.htm file would be helpful for indexing (see code).

david


Here it comes ^_^ (yeah, too much free time on thursday evenings, I know) (see sample output at the end) (and sadly as it is, candydoc indexfiles by modules.ddoc never worked for me...)


Code:

// creates an index.htm of all .htm and .html files in the current working directory
// marks Files bigger than minSize (6140B)

module makehtml;

import std.file : getcwd, listdir, getSize;
import std.stream : File;
import std.string : toString;

// file size threshold, bigger or equal sized files are emphasized
int minSize = 6140;

/// writes the char[][] fileContent on a one string per line basis to the file fileToWrite
void writeFileByLines(char[] fileToWrite, char[][] fileContent)
{
   File file = new File;
   file.create(fileToWrite);
   foreach(v; fileContent)
      file.writeLine(v);
   file.close();
}

/// removes _line number line from array
void removeLine(ref char[][] array, int line)
{
   for (int i=line; i < array.length - 1; i++)
      array[i] = array[i+1];
   array.length = array.length - 1;
}


void main()
{
   // first, list ALL files in current working dir
   char[][] dirContent = listdir(getcwd());
   
   // remove all files not ending htm or html, and remove "index.htm"
   foreach(i, v; dirContent)
      if (v.length > 5)
         if (((v[$-4..$] != "html") && (v[$-3..$] != "htm")) || (v == "index.htm"))      // untested for htm
         {
            removeLine(dirContent, i);
            i--;                     // evil modification of i, but else we skip the current line...
         }
         
   // prepare html stuff
   char[] beginHTML = "<html><body>";
   char[] endHTML = "</body></html>";
   dirContent.length = dirContent.length + 2;
   dirContent[1..$-1] = dirContent[0..$-2].dup;
   dirContent[0] = beginHTML;
   dirContent[$-1] = endHTML;
   
   // insert html coded links and descriptions, and emphasize files bigger than minSize
   foreach (i, ref line; dirContent)
   {
      if ((i != 0) && (i != dirContent.length-1))
      {
         if (getSize(line) >= minSize)
            dirContent[i] = "--------------------> <a href=\"" ~ line ~ "\">"
                        ~ (line[$-1]=='l'?line[0..$-5]:line[0..$-4]) ~ "</a> "
                        ~ toString(getSize(line)) ~ "<br>";   // ternary op: htm or html?
         else
            dirContent[i] = "<a href=\"" ~ line ~ "\">"
                        ~ (line[$-1]=='l'?line[0..$-5]:line[0..$-4]) ~ "</a> "
                        ~ toString(getSize(line)) ~ "<br>";   // ternary op: htm or html?
      }                  
   }

   writeFileByLines("index.htm", dirContent);
}



sample output (for minSize=6140B):
Quote:

advancable 6115
-------------------->animation 12847
array 6091
basicarchive 6135
-------------------->box 8242
boxcircle 6139
-------------------->boxframe 7269
Back to top
View user's profile Send private message
davidb



Joined: 03 Apr 2007
Posts: 15

PostPosted: Thu Apr 19, 2007 4:19 pm    Post subject: Reply with quote

hey, just discovered Pastebin: http://pastebin.co.uk/13236 !
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Thu Apr 19, 2007 7:01 pm    Post subject: Reply with quote

david wrote:

And I'm failing to understand widget.draw(),
although the picture won't show if
I omit it in the "main" loop (and just use it at the beginning).
All it should do is
assert(0)
and I just updated my repository, weird...
(Where did you hide the functionality,
come on, you can tell me Mr. Green )


Widget is simply a base class to all of the GUI widgets. Look at the Cgui.d file in the arcunittest's folder to see how to use the GUI. The GUI is really not going to be all the way done until Arc v.3, but it might do everything you need already.

Quote:

about documentation: Perhaps a short d program
that compiles the current trunk to docs (with candydoc)
and creates an index.html would be helpful?


Lutger already wrote it for me Razz

http://www.dsource.org/projects/arclib/browser/web/candydoc

I appreciate the effort, though : )
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> ArcLib All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group