Ren'Py Encrypting audio and working

Deleted member 416612

The 'landlord'
Donor
Game Developer
Feb 2, 2018
924
3,922
Hi mates,

Can anyone help me with a hint on how can I encrypt audio so that when the build is created, the sound to be functional?
I am using the following code in Option.rpy:

Code:
build.classify('game/images/**.png', 'images')
for audio, I used something like:

Code:
build.classify('game/audio/**.mp3, 'all')
At some point, it did encrypt the files when the build was done, but upon entering the game, the audio part was not functional.

Can anyone help me with advice about this?

Thank you!
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
Try this:
Code:
build.classify('game/**.ogg', 'archive')
build.classify('game/**.mp3', 'archive')
Covert your MP3 to OGG, seems that Renpy works better with them :p
( ) Free program for audio edition, effects and conversion.
 

Deleted member 416612

The 'landlord'
Donor
Game Developer
Feb 2, 2018
924
3,922
Try this:
Code:
build.classify('game/**.ogg', 'archive')
build.classify('game/**.mp3', 'archive')
Covert your MP3 to OGG, seems that Renpy works better with them :p
( ) Free program for audio edition, effects and conversion.
Nice, I will give it a try. Thank you!
 
  • Like
Reactions: Porcus Dev

Deleted member 416612

The 'landlord'
Donor
Game Developer
Feb 2, 2018
924
3,922
Try this:
Code:
build.classify('game/**.ogg', 'archive')
build.classify('game/**.mp3', 'archive')
Covert your MP3 to OGG, seems that Renpy works better with them :p
( ) Free program for audio edition, effects and conversion.
Ha, it worked. Thank you!
 

f95zoneuser463

Member
Game Developer
Aug 14, 2017
219
1,019
I just cannot hold back to point out that this is not encryption, just packing data into an archive.
I'm pretty damn sure this had nothing to do with changing the file-format. Check your build settings carefully. Verify the audio files where packed correctly with one of the many unpackers floating around the net.

My guess is you tried to put your audio files into a non existing 'all' archive with
build.classify('game/audio/**.mp3, 'all')
The default archive is 'archive' which is why mgomez0077's line worked.

Here is an example with multiple archives:
Python:
## DECLARE ARCHIVES
build.archive("audio","all")
build.archive("images","all")
build.archive("scripts","all")

## AUDIO
build.classify('**.mp3', 'audio')
build.classify('**.ogg', 'audio')
build.classify('**.opus','audio')

## GRAPHICS
build.classify('**.ico', 'images')
build.classify('**.ttf', 'images')
build.classify('**.png', 'images')
build.classify('**.jpg', 'images')
build.classify('**.webp','images')
build.classify('**.webm','images')

## SCRIPTS
build.classify('**.rpyc','scripts')

## DOCUMENTATION
build.documentation('*.html')
build.documentation('*.txt')
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
I just cannot hold back to point out that this is not encryption, just packing data into an archive.
I'm pretty damn sure this had nothing to do with changing the file-format. Check your build settings carefully. Verify the audio files where packed correctly with one of the many unpackers floating around the net.

My guess is you tried to put your audio files into a non existing 'all' archive with
build.classify('game/audio/**.mp3, 'all')
The default archive is 'archive' which is why mgomez0077's line worked.

Here is an example with multiple archives:
Python:
## DECLARE ARCHIVES
build.archive("audio","all")
build.archive("images","all")
build.archive("scripts","all")

## AUDIO
build.classify('**.mp3', 'audio')
build.classify('**.ogg', 'audio')
build.classify('**.opus','audio')

## GRAPHICS
build.classify('**.ico', 'images')
build.classify('**.ttf', 'images')
build.classify('**.png', 'images')
build.classify('**.jpg', 'images')
build.classify('**.webp','images')
build.classify('**.webm','images')

## SCRIPTS
build.classify('**.rpyc','scripts')

## DOCUMENTATION
build.documentation('*.html')
build.documentation('*.txt')
Yeah, it's not a format problem, I use ogg but at first I used some mp3 and there is no problem... I commented because so I read renpy works well with it and I think the size is lower, with videos is also recommended to use ogg, although you can use mp3 without problem.

The format wasn't the problem, but the command used to pack (not encrypt) the audios.
 

f95zoneuser463

Member
Game Developer
Aug 14, 2017
219
1,019
@mgomez0077
Sorry, misunderstood your post then.
Yep, based on mp3 has the worst quality vs bitrate out of all formats supported by Ren'Py (opus, vorbis/ogg, mp3). It's a shame that aac is not supported by Ren'Py. It's so common. Damn licenses. I use opus for audio. It's ridiculous how small these files are. So I'd recommend to switch away from mp3's too.
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
@mgomez0077
Sorry, misunderstood your post then.
Yep, based on mp3 has the worst quality vs bitrate out of all formats supported by Ren'Py (opus, vorbis/ogg, mp3). It's a shame that aac is not supported by Ren'Py. It's so common. Damn licenses. I use opus for audio. It's ridiculous how small these files are. So I'd recommend to switch away from mp3's too.
There's no reason to apologize, indeed, my message was a little confusing :p

Since my native language is not English, I sometimes write just enough without further explanation :LOL: