• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Fredrik Elmegren

  • Content count

  • Joined

  • Last visited

Community Reputation

102 Neutral

About Fredrik Elmegren

  • Rank
  1. Hey phantom and thanks for your reply! [quote name='phantom' timestamp='1328811614' post='4911391'] I don't think block and chunk are the same thing, if you follow the link to the WAVEFORMATEX structure details and then onto the MSDN page you'll find the following; [quote] Block alignment, in bytes. The block alignment is the minimum atomic unit of data for the [b]wFormatTag[/b] format type. If [b]wFormatTag[/b] is WAVE_FORMAT_PCM, [b]nBlockAlign[/b] must equal ([b]nChannels[/b] × [b]wBitsPerSample[/b]) / 8. For non-PCM formats, this member must be computed according to the manufacturer's specification of the format tag. [/quote] So for a 16bit stereo sample you get (2 x 16) / 8 or 4 bytes per sample. A 'chunk' on the other hand looks to be header + audio data, which will of course be larger than 4 bytes ;) [/quote] That's exactly what caused my confusion in the first place! Pulling apart wav-files I've been extracting various chunks ([url="http://www.sonicspot.com/guide/wavefiles.html"]look here[/url]), which makes the following [quote]If the IMA data is monaural, an individual chunk of data begins with the following preamble: bytes 0-1: initial predictor (in little-endian format) byte 2: initial index byte 3: unknown, usually 0 and is probably reserved [/quote] make no sense to me, at least if they are referring to the header+data-[i]chunks[/i]. But I would think they're actually referring to the blocks - on the other hand I heard/read/can't remember somewhere that IMA ADPCM cannot be decompressed per-block which would contradict each block having a header, that could've been in a dream though.. CONFUSED [img]http://public.gamedev.net//public/style_emoticons/default/blink.png[/img] ! Edit: Uh, I'm running so many parallell possible solutions to this little problem - I'll go back to the one I was working on when posting the images above and apply my new knowledge. This thread can be put on ice for now.
  2. The audio I'm working with comes from .wav-files which I presume means I should follow this: [url="http://wiki.multimedia.cx/index.php?title=Microsoft_IMA_ADPCM"]http://wiki.multimed...osoft_IMA_ADPCM[/url] I'm a bit confused on the [i]"This field reveals the size of a [b]block [/b]of IMA-encoded data."[/i] and that it then says [i]"an individual [b]chunk [/b]of data begins with the following preamble:"[/i]. I'm guessing they both refer to the same thing? So, from what I've interpreted I should do something like this: [code]foreach(adpcm_block in raw_audio_data) { var predictedValue = bytes 0 - 1 of adpcm_block var stepIndex = byte2 of adpcm_block // ignore byte 3 of adpcm_block foreach(4bit nibble in adpcm_block) // this would start on byte 4 (the fifth byte) in the block? { decompress(nibble) } }[/code] Does that look correct? If it does I'll have to post some code because I can't get it bloody right! [img]http://public.gamedev.net//public/style_emoticons/default/angry.png[/img]
  3. [quote name='Adam_42' timestamp='1327515078' post='4906158'] I suspect you're not resetting the parameters at the start of each block. See [url="http://wiki.multimedia.cx/index.php?title=Microsoft_IMA_ADPCM"]http://wiki.multimed...osoft_IMA_ADPCM[/url] for how it does that for MS ADPCM. [/quote] That sounds about right! Thanks for your reply! Although .. I'm having a bit of troubling getting my head around this.. Does this mean I should do the decoding in chunks? Right now I'm applying the decoding algorithm to the entire data: [source]int decode(int16* dst, const uint8* src, uint srcSize)[/source] where srcSize is the size of the encoded data in bits and my predictedValue and stepIndex continuously follow through to the next nibble-iteration. Do I need to instead do this per block (block align in fmt-chunk?)? perhaps something like this: [source]int decode(int16* dst, const uint8* src, int srcOffset, uint srcSize)[/source] where srcOffset is the current offset into the source data? Thanks in advance!
  4. Right! So I've implemented a decoder ([url="http://wiki.multimedia.cx/index.php?title=IMA_ADPCM"]http://wiki.multimedia.cx/index.php?title=IMA_ADPCM[/url]) to decode my IMA ADPCM sound.. buuuut the sound gets errrmm.. I'll let this picture talk for me: [img]http://i39.tinypic.com/353bb0x.png[/img] See the 'chunks' in the wave? (Oh, and it sounds like it looks btw) The first 'chunk' is perfect but then it goes dooownhill.. Any clue from just looking at this what I might be doing wrong? If not I'll post some code. Cheers!
  5. Thank you all for your replies! Sik you're spot on. We have [b]a lot[/b] of sound loaded into memory, where all the larger sound files already are vorbis compressed. It's all the smaller (400kb and less) uncompressed sounds we're trying to reduce the size of. I did some testing and came to the conclusion that Ogg Vorbis is not a viable solution for us as it would be too expensive performance-wise to decode. ADPCM seems to be the way to go here. We'd be able to compress all of our uncompressed wav down to a 1/4 in size which is quite nice. But, as I mentioned, we're using OpenAL which doesn't support ADPCM on Windows. This means I'll have to make a hack that decodes/decompresses the ADPCM-sound before sending it to OpenAL. Please reply if you think there's anything I should keep in mind when doing this. Again, thank you all [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
  6. [size=3]Hi![/size] [size=3]I'm about to start implementing support for playing compressed sound for our game engine. Unsurprisingly we're on a tight budget both performance-wise and memory-wise. I've been looking at the ADPCM-wav-compression and it could be a possible solution, although it would require a lot of extra hacking. We use OpenAL, and unfortunately it doesn't natively support ADPCM which would mean we'd have to 'manually' decompress the sound before sending it to OpenAL. [/size] [size=3]Right, so my question to you is: What sound compression would you recommend us using? As I said, performance is a big thing for us so the it can't have a large inpact on that.[/size] Cheers! / Freddy [size=3]ps. an audio-section here in the forums would be nice! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] [/size]
  7. [size=3]Thank you for your reply! Very much appreciated [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img][/size][size=3] [/size] [size=3]Alright, a follow up then: This being the case, could (should even?) I then decode the ADPCM sound to PCM (using eg. [url="http://msdn.microsoft.com/en-us/library/ms713455%28v=VS.85%29.aspx"]ACM[/url][/size][size=3]) and then send it to OpenAL? (I'm working with an existing environment/engine and would prefer not having ro rebuild the whole shebang (it's huuuge!))[/size] [size=3]Thanks again![/size] [size=3]Best regards,[/size] [size=3]Freddy[/size]
  8. [size=3]Hey![/size] [size=3]Right, I'm having a hard time finding out whether OpenAL supports playing ADPCM-compressed .wav or not in a windows environment.[/size] [size=3]So, before I go experimenting, does anyone know if OpenAL (in windows) can decode ADPCM on the fly or would I first need to decode the sound and then send it to OpenAL? [/size] [size=3]Thanks in advance![/size] [size=3]Best regards,[/size] [size=3]Freddy[/size]