Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,
I have few elementry sound files[1mb+ size] in res\raw , I am reading 2 at a time and mixing it as a conposite sound and sending it to audioTrack to play.

[before when I didn't got the idea of encrypting I used to read it as inputstream and process it then and there then release memory and then taking the next chunk]

Now when I know it is not secure ,I want to secure those elementry sounds.

the procedure I tried:
style 1>
encrypt the sound and pack in apk file and host in google.
decrypt the sound file at runtime and mix and play.

problem: It is crashing as I am reading the full 1mb in memory and decrypting in memory
and playing.

style 2>
decrypting and storing in cache or temporary file [taking space from external memory]

problem:If the person don't have sd card.
if they root it and copy the decrypted sound from temp folder.


style 3,4,5,.... Here I need helps :(

thanks in advance
Posted
Comments
Richard MacCutchan 22-Dec-14 12:08pm    
Help with what? If your data is too large for the physical memory of the system then you need to rethink your design.

1 solution

Is it important to encrypt your files or are you just attempting to make it harder to copy them. If its a case of just don't want them copied why not use a database file system like

Simple file system over SQLite[^]

Just a thought.

/Darren
 
Share this answer
 
Comments
shankha2010 23-Dec-14 0:49am    
Hi Darren,
Thanks for the reply.My only objective is no one should steal those files and reading should be very smooth [to avoid glitch while playing the sound.]

As per your plan I shall try in following way.
1>spliting the sound files in say 10 pieces
2>encrypt and keep it as blob in sqlite.
*That way i can avoid out of memory exception

*Only Not sure if the reading from db and decrypt will be smooth enough to avoid glitches.

I'll try this.please let me know if you have any other plan.
thanks again :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900