java实现歌词分割代码 java歌词高亮显示滚动-成都创新互联网站建设

关于创新互联

多方位宣传企业产品与服务 突出企业形象

公司简介 公司的服务 荣誉资质 新闻动态 联系我们

java实现歌词分割代码 java歌词高亮显示滚动

在java中怎么从键盘输入一段歌词以空格用split()分割

public static void main(String[] args) {

创新互联建站是一家专业从事网站设计制作、做网站的网络公司。作为专业网站设计公司,创新互联建站依托的技术实力、以及多年的网站运营经验,为您提供专业的成都网站建设、成都全网营销推广及网站设计开发服务!

// TODO 自动生成的方法存根

Scanner sc = new Scanner(System.in);

System.out.println("请输入歌词:");

String s = sc.nextLine();

String[] x = s.split(" ");

for(int i = 0;ix.length;i++){

System.out.println(x[i]);

}

}

JAVA截取字符串(截取歌词)

把歌词存在一个叫 geci.txt 的文本中 放在D盘根目录

import java.io.BufferedReader;

import java.io.FileNotFoundException;

import java.io.FileReader;

import java.io.IOException;

public class SaveSong {

/**

* @param args

*/

public static void main(String[] args) {

// TODO Auto-generated method stub

BufferedReader br = null;

String lineContent = "";

String[] s = new String[100];

int i = 0;

try {

br = new BufferedReader(new FileReader("D:\\geci.txt"));

} catch (FileNotFoundException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

}

try {

while ((lineContent = br.readLine()) != null) {

System.out.println(lineContent);

s[i]= lineContent;

i++;

}

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

}

怎样用JAVA流来分割一个mp3文件代码

package xuan;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.OutputStream;

import java.nio.Buffer;

import java.io.BufferedInputStream;

import java.io.BufferedOutputStream;

public class mp3 {

public static void cutMusic() throws IOException{

File file=new File("E:\\薛之谦 - 那是你离开了北京的生活.flac");

File file2=new File("E:\\music");

FileInputStream fis =new FileInputStream(file);

FileOutputStream fos=null;

//if(file2.exists()!=true) {

// file2.mkdirs();

//}

int len=0;

int x=0;

int y=1020*1024;

byte [] one=new byte[y];

if(file.length()%y!=0) {

x=(int)(file.length()/y+1);

}else if(file.length()%y==0) {

x=(int)(file.length()/y);

}

for(int i=1;i=x;i++) {

len=fis.read(one);

fos=new FileOutputStream (new File(file2,i+".flac"));

fos.write(one,0,len);

}

fis.close();

fos.close();

}

public static void mergeMusic()throws IOException{

File file=new File("E:\\merge.flac");

File file2=new File("E:\\music");

// if(file.exists()!=true) {

// file.createNewFile();

// }

File[]f=file2.listFiles();

FileInputStream fis=null;

FileOutputStream fos=new FileOutputStream(file);

BufferedOutputStream bos =new BufferedOutputStream(fos,1024*1024);

int len=0;

for(int i=0;if.length;i++) {

fis =new FileInputStream(f[i]);

BufferedInputStream bis =new BufferedInputStream(fis,1024*1024);

while((len=bis.read())!=-1) {

bos.write(len);

}

fos.flush();

fis.close();

}

bos.close();

fos.close();

}

public static void main(String[] args) throws IOException{

cutMusic();

mergeMusic();

// TODO Auto-generated method stub

}

}


网站题目:java实现歌词分割代码 java歌词高亮显示滚动
分享URL:http://kswsj.cn/article/dddddis.html

其他资讯