convert

How to convert g729 encoded byte array to .WAV in C#?

匿名 (未验证) 提交于 2019-12-03 03:09:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have been working on a VoIP Application in C sharp language. The purpose of the project is VoIP Call Recording. It uses g729 Codec. I can extract the voice part from RTP payload. How to convert this Byte array to .wav format? Please help me. 回答1: You can try to use ffmpeg.exe and work with it via command line 文章来源: How to convert g729 encoded byte array to .WAV in C#?

How do I increment an IP address represented as a string?

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an IP address in char type Like char ip = "192.123.34.134" I want increment the last value (134). Does anyone how should i do it? I think, i should convert it to an integer, and then back, but unfortunately i don't know how? :( I'm using C++. Please help me! Thanks, kampi 回答1: You can convert the IP address from a string to an integer using inet_addr , then, after manipulating it, convert it back to a string with inet_ntoa . See the documentation for these functions for more info on how to use them. Here's a small function that will

Convert C++ string variable to long

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a variable: string item; It gets initialized at run-time. I need to convert it to long. How to do it? I have tried atol() and strtol() but I always get following error for strtol() and atol() respectively: cannot convert 'std::string' to 'const char*' for argument '1' to 'long int strtol(const char*, char**, int)' cannot convert 'std::string' to 'const char*' for argument '1' to 'long int atol(const char*)' 回答1: Try like this: long i = atol(item.c_str()); 回答2: c++11: long l = std::stol(item); http://en.cppreference.com/w/cpp/string

Convert a single color with cvtColor

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a color that I want to convert to a different color space. Is it possible to use cvtColor on a cv::Vec3f directly without creating a 1x1 cv::Mat and populating it with that pixel, using cvtColor on the cv::Mat , then getting the only pixel out of the output? I have tried the following, but it doesn't seem to like getting passed a vector. Any suggestions? #include #include int main(int, char*[]) { cv::Vec3f hsv; hsv[0] = .9; hsv[1] = .8; hsv[2] = .7; std::cout I also tried this, but get a different error: #include #include int main(int

How to convert degree minutes second into decimal in java

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is a basically gps application where i am getting the latitude information from the meta data of a picture in this format 28"41'44.13597 . My need is to convert the same information into decimal and the out will show data in decimal format like 28.705450. Please help through code or any references Thanks in advance 回答1: /** answer=hour+minutes/60+seconds/3600 */ public double convertHourToDecimal(String degree) { if(!degree.matches("(-)?[0-6][0-9]\"[0-6][0-9]\'[0-6][0-9](.[0-9]{1,5})?") throw new IllegalArgumentException(); String[]

Convert MediaWiki wikitext format to HTML using command line

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tend to write a good amount of documentation so the MediaWiki format to me is easy for me to understand plus it saves me a lot of time than having to write traditional HTML. I, however, also write a blog and find that switching from keyboard to mouse all the time to input the correct tags for HTML adds a lot of time. I'd like to be able to write my articles in Mediawiki syntax and then convert it to HTML for use on my blog. I've tried Google-ing but must need better nomenclature as surprisingly I haven't been able to find anything. I use

How do I convert json array to bash array of strings with jq?

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: How do I parse a json array of objects to a bash array with those objects as strings? I am trying to do the following: CONVO = $ ( get_json_array | jq '.[]' ) for CONVERSATION in $CONVERSATIONS do echo "${CONVERSATION}" done But the echo prints out lines instead of the specific objects. The format of the object is: { "key1" : "value1" , "key2" : "value2" } and I need to pass it to an api: api_call '{ "key1":"value1", "key2": "value2"}' 回答1: The problem is that jq is still just outputting lines of text; you can't necessarily

Angular 4, convert http response observable to object observable

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm new to the concepts of observables and need some help with a conversion. I have a service which returns an Observable<Response> from a Http request, but I need to convert it do an Observable<PriceTag> to use it on a DataSource inside the connect method. Is there anyway to do this? This is the method from my service: getPriceTags(): Observable<Response> { // Set the request headers const headers = new Headers({ 'Content-Type': 'application/json' }); // Returns the request observable return this.http.post(Constants.WEBSERVICE_ADDRESS + "

Convert java Object to CSV

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What API should I use to convert Java object to CSV. Can I use google-gson for java object conversion to CSV format? 回答1: Jackson provides for easy conversion to/from CSV (with Java and/or JSON). The post at http://www.cowtowncoder.com/blog/archives/2012/03/entry_468.html describes well how to use it. 回答2: please give me your specific requirements about GSON. Gson provides toJson() and fromJson() methods to convert Java objects to JSON and vice-versa. can u refer this link . This link gives the list of API available under the GSON 回答3: This

How to convert u32string to int in C++11?

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: How can we convert u32string to int in C++11? Additional, what method should I use to convert part of such string to int - lets say having begin and end iterator available? I've tried: u32string test = U "14" ; cout << atoi ( test . c_str ()); but it throws: candidate function not viable : no known conversion from 'const char32_t *' to 'const char *' for 1st argument extern int atoi ( __const char * __nptr ) 回答1: #include <locale> // wstring_convert #include <codecvt> // codecvt_utf8 #include <iostream> // cout #include <string> //